]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ContentHash.pm
lei mail-diff: diagnostic command to diff mail contents
[public-inbox.git] / lib / PublicInbox / ContentHash.pm
index cc4a54c922d09c9788cfb63b03097631ecc7bcb0..f6ae9011c1bf2d471e239550fd7347c85adbeb3f 100644 (file)
@@ -52,9 +52,9 @@ sub content_dig_i {
        $dig->add($s);
 }
 
-sub content_digest ($) {
-       my ($eml) = @_;
-       my $dig = Digest::SHA->new(256);
+sub content_digest ($;$) {
+       my ($eml, $dig) = @_;
+       $dig //= Digest::SHA->new(256);
 
        # References: and In-Reply-To: get used interchangeably
        # in some "duplicates" in LKML.  We treat them the same