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-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 299B21FA13 for ; Mon, 7 Dec 2020 07:40:54 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/5] extsearchidx: remove needless SHA-1 check Date: Mon, 7 Dec 2020 07:40:51 +0000 Message-Id: <20201207074053.14483-4-e@80x24.org> In-Reply-To: <20201207074053.14483-1-e@80x24.org> References: <20201207074053.14483-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: There is no need to verify checksums of data already stored in git. Doing this ourselves also limits flexibility in moving to other hashes. --- lib/PublicInbox/ExtSearchIdx.pm | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index 4de47b58..819c7903 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -91,14 +91,6 @@ sub attach_config { $cfg->each_inbox(\&_ibx_attach, $self); } -sub git_blob_digest ($) { - my ($bref) = @_; - my $dig = Digest::SHA->new(1); # XXX SHA256 later - $dig->add('blob '.length($$bref)."\0"); - $dig->add($$bref); - $dig; -} - sub is_bad_blob ($$$$) { my ($oid, $type, $size, $expect_oid) = @_; if ($type ne 'blob') { @@ -245,10 +237,6 @@ sub cur_ibx_xnum ($$) { my ($req, $bref) = @_; my $ibx = $req->{ibx} or die 'BUG: current {ibx} missing'; - # XXX overkill? - git_blob_digest($bref)->hexdigest eq $req->{oid} or die - "BUG: blob mismatch $req->{oid}"; - $req->{eml} = PublicInbox::Eml->new($bref); $req->{chash} = content_hash($req->{eml}); $req->{mids} = mids($req->{eml});