about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-06-22 08:02:53 +0000
committerEric Wong <e@80x24.org>2022-06-22 16:33:16 +0000
commit70209c643bd5b21d369dff684218714f5186993b (patch)
tree47868c8e45202f758ecb355dd3f1d5ad559ece6d
parent67a14a83daa54ca29e18504fd87e1196b20018bc (diff)
downloadpublic-inbox-70209c643bd5b21d369dff684218714f5186993b.tar.gz
This allows us to free up some memory sooner rather than later
in case ordersub is expensive.
-rw-r--r--lib/PublicInbox/SearchThread.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/SearchThread.pm b/lib/PublicInbox/SearchThread.pm
index cc8c90ce..00ae9fac 100644
--- a/lib/PublicInbox/SearchThread.pm
+++ b/lib/PublicInbox/SearchThread.pm
@@ -167,7 +167,7 @@ sub order_children {
         while (defined($cur = shift @q)) {
                 # the {children} hashref here...
                 my @c = grep { !$seen{$_}++ && visible($_, $ibx) }
-                        values %{$cur->{children}};
+                        values %{delete $cur->{children}};
                 $ordersub->(\@c) if scalar(@c) > 1;
                 $cur->{children} = \@c; # ...becomes an arrayref
                 push @q, @c;