From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8D9E5209BA for ; Wed, 5 Oct 2016 23:57:26 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/17] thread: remove rootset accessor method Date: Wed, 5 Oct 2016 23:57:12 +0000 Message-Id: <20161005235722.14857-8-e@80x24.org> In-Reply-To: <20161005235722.14857-1-e@80x24.org> References: <20161005235722.14857-1-e@80x24.org> List-Id: 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 d39e9b6..7e89946 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 748e391..7554d54 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; -- EW