From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id ED06A1F8C8 for ; Mon, 4 Oct 2021 11:12:34 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] extsearchidx: favor 20-byte OID comparison Date: Mon, 4 Oct 2021 00:12:34 -1100 Message-Id: <20211004111234.25584-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: As with most of our internal-only code, favor smaller comparisons to reduce memory traffic. --- lib/PublicInbox/ExtSearchIdx.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index eb7c3d67e072..3a1856c84709 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -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};