diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-08-04 13:52:33 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-08-04 13:53:18 +1200 |
commit | 12090e3cdddbc5c6ca9eebc6cdbd27a111c1a633 (patch) | |
tree | d9bf956fbf360c0061e23c1334ec95ca59af02e2 /checkem | |
parent | Allow choosing another SHA alg (diff) | |
download | checkem-12090e3cdddbc5c6ca9eebc6cdbd27a111c1a633.tar.gz (sig) checkem-12090e3cdddbc5c6ca9eebc6cdbd27a111c1a633.zip |
Inline digest assignmentv2.3
Diffstat (limited to 'checkem')
-rwxr-xr-x | checkem | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -24,7 +24,7 @@ use Digest::SHA; use 5.009003; # Version number to make Perl::Critic happy -our $VERSION = 2.2; +our $VERSION = 2.3; # If no arguments, work with the current working directory croak('Need at least one dir to search') if !@ARGV; @@ -83,8 +83,7 @@ FS: for my $fs ( grep { @{$_} > 1 } values %sizes ) { # Files still the same size and not hard linked, group by digest; # create the digest object if it isn't already defined - $dig //= Digest::SHA->new($alg); - $dig->addfile( $f->{fn} ); + ( $dig //= Digest::SHA->new($alg) )->addfile( $f->{fn} ); push @{ $sums{ $dig->digest() } }, $f; } } |