]> Sergey Matveev's repositories - public-inbox.git/commitdiff
extsearchidx: favor 20-byte OID comparison
authorEric Wong <e@80x24.org>
Mon, 4 Oct 2021 11:12:34 +0000 (00:12 -1100)
committerEric Wong <e@80x24.org>
Tue, 5 Oct 2021 23:09:39 +0000 (23:09 +0000)
As with most of our internal-only code, favor smaller
comparisons to reduce memory traffic.

lib/PublicInbox/ExtSearchIdx.pm

index eb7c3d67e072c5435936a813868d3dcc74b8e06b..3a1856c847096f71df18ad3d6291a96422185e1a 100644 (file)
@@ -120,9 +120,8 @@ sub apply_boost ($$) {
                                ||
                $a->[1] <=> $b->[1] # break ties with {xnum}
        } @$xr3;
-       my $top_blob = unpack('H*', $xr3->[0]->[2]);
        my $new_smsg = $req->{new_smsg};
-       return if $top_blob ne $new_smsg->{blob}; # loser
+       return if $xr3->[0]->[2] ne pack('H*', $new_smsg->{blob}); # loser
 
        # replace the old smsg with the more boosted one
        $new_smsg->{num} = $smsg->{num};