diff options
author | Eric Wong <e@80x24.org> | 2016-10-05 23:47:32 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-10-05 23:53:38 +0000 |
commit | c76585db3daa7910edf5f4c048d783b67e2c2315 (patch) | |
tree | 3f2bb41a6477fcb2052fc8bb6ab39676d77729b7 /lib/PublicInbox | |
parent | fdd089ee175bf458d2674893e19b4af2edd82b4e (diff) | |
download | public-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')
-rw-r--r-- | lib/PublicInbox/SearchThread.pm | 5 |
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 { |