about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-06-22 08:02:52 +0000
committerEric Wong <e@80x24.org>2022-06-22 16:33:14 +0000
commit67a14a83daa54ca29e18504fd87e1196b20018bc (patch)
treee4435c925d3839805143589b6950cce79560f7e9
parent3d280ae91480d846f31a05890d59d0d1d42df129 (diff)
downloadpublic-inbox-67a14a83daa54ca29e18504fd87e1196b20018bc.tar.gz
No point in wasting several kilobytes of memory for a single-use
one-line sub.
-rw-r--r--lib/PublicInbox/SearchThread.pm11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm
index f07dd696..cc8c90ce 100644
--- a/lib/PublicInbox/SearchThread.pm
+++ b/lib/PublicInbox/SearchThread.pm
@@ -38,13 +38,13 @@ sub thread {
                 # TODO: move this to a more appropriate place, breaks tests
                 # if we do it during psgi_cull
                 delete $_->{num};
-
-                PublicInbox::SearchThread::Msg::cast($_);
+                bless $_, 'PublicInbox::SearchThread::Msg';
                 if (exists $id_table{$_->{mid}}) {
                         $_->{children} = [];
                         push @imposters, $_; # we'll deal with them later
                         undef;
                 } else {
+                        $_->{children} = {}; # will become arrayref later
                         $id_table{$_->{mid}} = $_;
                         defined($_->{references});
                 }
@@ -108,13 +108,6 @@ sub ghost {
         }, __PACKAGE__;
 }
 
-# give a existing smsg the methods of this class
-sub cast {
-        my ($smsg) = @_;
-        $smsg->{children} = {};
-        bless $smsg, __PACKAGE__;
-}
-
 sub topmost {
         my ($self) = @_;
         my @q = ($self);