* [PATCH 11/17] thread: order_children no longer cares about depth
2016-10-05 23:57 5% [PATCH 0/17] remove Mail::Thread dependency Eric Wong
@ 2016-10-05 23:57 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-10-05 23:57 UTC (permalink / raw)
To: meta
We never use the depth anywhere in this sub
---
lib/PublicInbox/SearchThread.pm | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm
index ba31f43..2e7b79a 100644
--- a/lib/PublicInbox/SearchThread.pm
+++ b/lib/PublicInbox/SearchThread.pm
@@ -203,7 +203,6 @@ sub order_children {
my ($walk, $ordersub) = @_;
my %seen;
- my $depth = 0;
my @visited;
while ($walk) {
push @visited, $walk;
@@ -222,17 +221,13 @@ sub order_children {
}
# go down, or across
- if ($child) {
- $next = $child;
- ++$depth;
- }
+ $next = $child if $child;
# no next? look up
if (!$next) {
my $up = $walk;
while ($up && !$next) {
$up = $up->{parent};
- --$depth;
$next = $up->{next} if $up;
}
}
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/17] remove Mail::Thread dependency
@ 2016-10-05 23:57 5% Eric Wong
2016-10-05 23:57 7% ` [PATCH 11/17] thread: order_children no longer cares about depth 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 5%]
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 5% [PATCH 0/17] remove Mail::Thread dependency Eric Wong
2016-10-05 23:57 7% ` [PATCH 11/17] thread: order_children no longer cares about depth 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).