about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchThread.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-10-05 23:47:32 +0000
committerEric Wong <e@80x24.org>2016-10-05 23:53:38 +0000
commitc76585db3daa7910edf5f4c048d783b67e2c2315 (patch)
tree3f2bb41a6477fcb2052fc8bb6ab39676d77729b7 /lib/PublicInbox/SearchThread.pm
parentfdd089ee175bf458d2674893e19b4af2edd82b4e (diff)
downloadpublic-inbox-c76585db3daa7910edf5f4c048d783b67e2c2315.tar.gz
We have to walk through all the messages after threading
anyways to build the rootset, so we can just delete all
the parent references at that point.
Diffstat (limited to 'lib/PublicInbox/SearchThread.pm')
-rw-r--r--lib/PublicInbox/SearchThread.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm
index 05de9ec5..003a8d11 100644
--- a/lib/PublicInbox/SearchThread.pm
+++ b/lib/PublicInbox/SearchThread.pm
@@ -33,7 +33,7 @@ sub thread {
         my $self = shift;
         _add_message($self, $_) foreach @{$self->{messages}};
         my $id_table = delete $self->{id_table};
-        $self->{rootset} = [ grep { !$_->{parent} } values %$id_table ];
+        $self->{rootset} = [ grep { !delete $_->{parent} } values %$id_table ];
 }
 
 sub _get_cont_for_id ($$) {
@@ -90,7 +90,6 @@ package PublicInbox::SearchThread::Msg;
 use strict;
 use warnings;
 use Carp qw(croak);
-use Scalar::Util qw(weaken);
 
 sub new {
         bless {
@@ -112,7 +111,7 @@ sub add_child {
                 delete $parent->{children}->{$cid};
         }
 
-        weaken($child->{parent} = $self);
+        $child->{parent} = $self;
 }
 
 sub has_descendent {