about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-17 09:28:49 +0000
committerEric Wong <e@yhbt.net>2020-04-17 09:52:26 +0000
commitd0147582e289fdd4cdd84e91d8b0f8ae9c230124 (patch)
tree02d60802e4eef79bbbe7f9ca4a2210f2d3a07f28 /lib/PublicInbox/SearchView.pm
parentc23c96b1da7bfff3efe64ad415c0feb424d34559 (diff)
downloadpublic-inbox-d0147582e289fdd4cdd84e91d8b0f8ae9c230124.tar.gz
We can rid ourselves of a layer of indirection by subclassing
PublicInbox::Smsg instead of using a container object to hold
each $smsg.  Furthermore, the `{id}' vs. `{mid}' field name
confusion is eliminated.

This reduces the size of the $rootset passed to walk_thread by
around 15%, that is over 50K memory when rendering a /$INBOX/
landing page.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 4fbf59ef..4336e4d9 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -243,8 +243,8 @@ sub search_nav_bot {
 
 sub sort_relevance {
         [ sort {
-                (eval { $b->topmost->{smsg}->{pct} } // 0) <=>
-                (eval { $a->topmost->{smsg}->{pct} } // 0)
+                (eval { $b->topmost->{pct} } // 0) <=>
+                (eval { $a->topmost->{pct} } // 0)
         } @{$_[0]} ]
 }