This allows us to free up some memory sooner rather than later
in case ordersub is expensive.
---
 lib/PublicInbox/SearchThread.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to