diff options
author | Eric Wong <e@80x24.org> | 2020-11-13 11:11:43 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-11-15 06:12:38 +0000 |
commit | 834181c640236c91f367de04d5cc9834ec617f4e (patch) | |
tree | ab66b20e35c39914856034a64a3728697217d510 /lib | |
parent | 0d0b58966b2ae7e96848c2f05491a66c62531385 (diff) | |
download | public-inbox-834181c640236c91f367de04d5cc9834ec617f4e.tar.gz |
*index: discard sync->{todo} on iteration
There's no need to continuously append to {todo} when indexing multiple inboxes. They're not redundantly indexed (because the IdxStack is discarded, making it a noop), but it's still a waste of memory keeping the $unit hashrefs around.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/ExtSearchIdx.pm | 2 | ||||
-rw-r--r-- | lib/PublicInbox/V2Writable.pm | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index 2d230dc1..6c09c460 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -308,7 +308,7 @@ sub _sync_inbox ($$$) { warn "E: $ekey unsupported inbox version (v$v)\n"; return; } - index_todo($self, $sync, $_) for @{$sync->{todo}}; + index_todo($self, $sync, $_) for @{delete($sync->{todo}) // []}; } sub eidx_sync { # main entry point diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index cf44c95b..11cde627 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -1351,7 +1351,7 @@ sub index_sync { } } # work forwards through history - index_todo($self, $sync, $_) for @{$sync->{todo}}; + index_todo($self, $sync, $_) for @{delete($sync->{todo}) // []}; $self->{oidx}->rethread_done($opt); $self->done; |