From 69225ecae508b9bb83960ac51e38d7d5eade2a6a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 25 Sep 2021 22:16:45 +0000 Subject: search: avoid setting undef hashtable entries `undef' entries still take up a slot in the hash table, and cause the `exists' check to false-positive in ->cleanup_shards. This should fully fix the (innocuous) messages introduced in commit 63d7b8ce (daemons: revamp periodic cleanup task, 2021-09-23) --- lib/PublicInbox/Search.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/PublicInbox/Search.pm') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index d285c11c..17e202e1 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -234,12 +234,12 @@ sub mset_to_artnums { sub xdb ($) { my ($self) = @_; - $self->{xdb} //= do { + $self->{xdb} // do { my @xdb = $self->xdb_shards_flat or return; $self->{nshard} = scalar(@xdb); my $xdb = shift @xdb; $xdb->add_database($_) for @xdb; - $xdb; + $self->{xdb} = $xdb; }; } @@ -261,10 +261,10 @@ sub new { my ($class, $ibx) = @_; ref $ibx or die "BUG: expected PublicInbox::Inbox object: $ibx"; my $xap = $ibx->version > 1 ? 'xap' : 'public-inbox/xapian'; - bless { - xpfx => "$ibx->{inboxdir}/$xap" . SCHEMA_VERSION, - altid => $ibx->{altid}, - }, $class; + my $xpfx = "$ibx->{inboxdir}/$xap".SCHEMA_VERSION; + my $self = bless { xpfx => $xpfx }, $class; + $self->{altid} = $ibx->{altid} if defined($ibx->{altid}); + $self; } sub reopen { -- cgit v1.2.3-24-ge0c7