]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiSearch.pm
search: simplify initialization, add ->xdb_shards_flat
[public-inbox.git] / lib / PublicInbox / LeiSearch.pm
index 9cfd6ea2fd5292e527659d193879e392a2669968..66c16e0485fd611f7dbad6186301bb920426d8b5 100644 (file)
@@ -9,8 +9,7 @@ use PublicInbox::Search;
 
 sub combined_docid ($$) {
        my ($self, $num) = @_;
-       my $nshard = ($self->{nshard} // 1);
-       ($num - 1) * $nshard  + 1;
+       ($num - 1) * $self->{nshard} + 1;
 }
 
 sub msg_keywords {
@@ -19,7 +18,7 @@ sub msg_keywords {
        my $docid = ref($num) ? $num->get_docid : do {
                # get combined docid from over.num:
                # (not generic Xapian, only works with our sharding scheme)
-               my $nshard = $self->{nshard} // 1;
+               my $nshard = $self->{nshard};
                ($num - 1) * $nshard + $num % $nshard + 1;
        };
        my %kw;