From 770c3c93b8a6a0db9e2152a67bccb257fa7c0233 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Oct 2016 23:47:22 +0000 Subject: thread: remove rootset accessor method It doesn't buy us much and copying to a new array is slower; but probably not measurable in real-world use. --- lib/PublicInbox/SearchThread.pm | 2 -- lib/PublicInbox/View.pm | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm index d39e9b62..7e89946d 100644 --- a/lib/PublicInbox/SearchThread.pm +++ b/lib/PublicInbox/SearchThread.pm @@ -29,8 +29,6 @@ sub new { }, $_[0]; } -sub rootset { @{$_[0]{rootset}} } - sub thread { my $self = shift; $self->_setup(); diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 748e3910..7554d54f 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -259,7 +259,7 @@ sub _th_index_lite { sub walk_thread { my ($th, $ctx, $cb) = @_; - my @q = map { (0, $_) } $th->rootset; + my @q = map { (0, $_) } @{$th->{rootset}}; while (@q) { my $level = shift @q; my $node = shift @q or next; @@ -291,7 +291,7 @@ sub stream_thread ($$) { my ($th, $ctx) = @_; my $inbox = $ctx->{-inbox}; my $mime; - my @q = map { (0, $_) } $th->rootset; + my @q = map { (0, $_) } @{$th->{rootset}}; my $level; while (@q) { $level = shift @q; -- cgit v1.2.3-24-ge0c7