* [PATCH 08/17] thread: simplify
2016-10-05 23:57 7% [PATCH 0/17] remove Mail::Thread dependency Eric Wong
@ 2016-10-05 23:57 6% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-10-05 23:57 UTC (permalink / raw)
To: meta
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(-)
diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm
index 7e89946..a161662 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) = @_;
--
EW
^ permalink raw reply related [relevance 6%]
* [PATCH 0/17] remove Mail::Thread dependency
@ 2016-10-05 23:57 7% Eric Wong
2016-10-05 23:57 6% ` [PATCH 08/17] thread: simplify Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-10-05 23:57 UTC (permalink / raw)
To: meta
This greatly reduces the amount of code we need to load while
reducing abstractions which slow us down and hurt memory use
when displaying gigantic threads.
More may be done and we may use SearchMsg directly for threading
in the future and obviate the need for the container
abstraction.
Eric Wong (17):
view: remove "subject dummy" references
thread: remove Mail::Thread dependency
thread: pass array refs instead of entire arrays
thread: remove accessor usage in internals
inbox: deal with ghost smsg
thread: remove Email::Abstract wrapping
thread: remove rootset accessor method
thread: simplify
thread: remove iterate_down
thread: avoid incrementing undefined value
thread: order_children no longer cares about depth
thread: inline and remove recurse_down logic
thread: fix sorting without topmost
thread: use hash + array instead of hand-rolled linked list
view: remove redundant children array in thread views
t/thread-cycle: test self-referential messages
thread: remove weaken dependency
INSTALL | 1 -
MANIFEST | 3 +-
Makefile.PL | 1 -
lib/PublicInbox/Inbox.pm | 2 +
lib/PublicInbox/SearchIdx.pm | 4 +-
lib/PublicInbox/SearchMsg.pm | 29 -------
lib/PublicInbox/SearchThread.pm | 147 +++++++++++++++++++++++++++++++++++
lib/PublicInbox/SearchView.pm | 15 ++--
lib/PublicInbox/Thread.pm | 86 ---------------------
lib/PublicInbox/View.pm | 165 ++++++++++++++++++----------------------
lib/PublicInbox/WWW.pm | 2 +-
t/plack.t | 3 +-
t/search.t | 7 +-
t/thread-cycle.t | 97 +++++++++++++++++++++++
14 files changed, 333 insertions(+), 229 deletions(-)
^ permalink raw reply [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-10-05 23:57 7% [PATCH 0/17] remove Mail::Thread dependency Eric Wong
2016-10-05 23:57 6% ` [PATCH 08/17] thread: simplify Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).