unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 3/5] extsearchidx: remove needless SHA-1 check
Date: Mon,  7 Dec 2020 07:40:51 +0000	[thread overview]
Message-ID: <20201207074053.14483-4-e@80x24.org> (raw)
In-Reply-To: <20201207074053.14483-1-e@80x24.org>

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});

  parent reply	other threads:[~2020-12-07  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07  7:40 [PATCH 0/5] extindex: random cleanups Eric Wong
2020-12-07  7:40 ` [PATCH 1/5] over: gracefully show invalid ibx_id Eric Wong
2020-12-07  7:40 ` [PATCH 2/5] overidx: wrap eidx_key => ibx_id mapping Eric Wong
2020-12-07  7:40 ` Eric Wong [this message]
2020-12-07  7:40 ` [PATCH 4/5] searchidx: remove $oid parameter from most calls Eric Wong
2020-12-07  7:40 ` [PATCH 5/5] shard_add_eidx_info: pass $eidx_key instead of $ibx object Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201207074053.14483-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).