+ my ($msgs, $ordersub, $ctx) = @_;
+
+ # A. put all current $msgs (non-ghosts) into %id_table
+ my %id_table = map {;
+ # this delete saves around 4K across 1K messages
+ # TODO: move this to a more appropriate place, breaks tests
+ # if we do it during psgi_cull
+ delete $_->{num};
+
+ $_->{mid} => PublicInbox::SearchThread::Msg::cast($_);
+ } @$msgs;