From fcdf58e256f1668ba0d6e78806909c5981615a03 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Oct 2016 23:47:23 +0000 Subject: thread: simplify Single use subroutines actually make the code more complex in this case, and there's never a {seen} field in $self. --- lib/PublicInbox/SearchThread.pm | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'lib/PublicInbox/SearchThread.pm') diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm index 7e89946d..a1616620 100644 --- a/lib/PublicInbox/SearchThread.pm +++ b/lib/PublicInbox/SearchThread.pm @@ -31,16 +31,10 @@ sub new { sub thread { my $self = shift; - $self->_setup(); + _add_message($self, $_) foreach @{$self->{messages}}; $self->{rootset} = [ grep { !$_->{parent} } values %{$self->{id_table}} ]; - $self->_finish(); -} - -sub _finish { - my $self = shift; delete $self->{id_table}; - delete $self->{seen}; } sub _get_cont_for_id ($$) { @@ -48,12 +42,6 @@ sub _get_cont_for_id ($$) { $self->{id_table}{$mid} ||= PublicInbox::SearchThread::Msg->new($mid); } -sub _setup { - my ($self) = @_; - - _add_message($self, $_) foreach @{$self->{messages}}; -} - sub _add_message ($$) { my ($self, $smsg) = @_; -- cgit v1.2.3-24-ge0c7