]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: clobber -user_pfx on query parser initialization
authorEric Wong <e@yhbt.net>
Sat, 21 Mar 2020 02:03:51 +0000 (02:03 +0000)
committerEric Wong <e@yhbt.net>
Wed, 25 Mar 2020 01:48:35 +0000 (01:48 +0000)
While we don't currently reinitialize the query parser for
the lifetime of a PublicInbox::Search object and have no plans
to, it's incorrect to be appending to an existing array in
case we reininitialize the query parser in the future.

lib/PublicInbox/Search.pm

index 9a394404a734f117baf1471934447751013fd9d5..fabf5301f163187035c2cdd1a51895e98ba8116a 100644 (file)
@@ -313,7 +313,7 @@ sub qp {
        # we do not actually create AltId objects,
        # just parse the spec to avoid the extra DB handles for now.
        if (my $altid = $self->{altid}) {
-               my $user_pfx = $self->{-user_pfx} ||= [];
+               my $user_pfx = $self->{-user_pfx} = [];
                for (@$altid) {
                        # $_ = 'serial:gmane:/path/to/gmane.msgmap.sqlite3'
                        /\Aserial:(\w+):/ or next;