Fix implicit return (PBP)

This commit is contained in:
Dan Church 2023-07-20 12:37:27 -05:00
parent 7dbbb5422a
commit 31fe372e09
Signed by: h3xx
GPG Key ID: EA2BF379CD2CDBD0
9 changed files with 14 additions and 10 deletions

View File

@ -15,7 +15,7 @@ sub new {
(@{$self}{qw/ dev ino mode nlink uid gid rdev size (@{$self}{qw/ dev ino mode nlink uid gid rdev size
atime mtime ctime blksize blocks /}) atime mtime ctime blksize blocks /})
= lstat $self->{name}; = lstat $self->{name};
$self return $self;
} }
sub hash { sub hash {
@ -26,7 +26,7 @@ sub hash {
$ctx->addfile($self->{name}); $ctx->addfile($self->{name});
$self->{_hash} = $ctx->hexdigest; $self->{_hash} = $ctx->hexdigest;
} }
$self->{_hash} return $self->{_hash};
} }
1; 1;

View File

@ -47,11 +47,12 @@ sub add {
} }
$self->{_files_in_hash}->{$file->{name}} = 1; $self->{_files_in_hash}->{$file->{name}} = 1;
} }
return;
} }
sub entries { sub entries {
my $self = shift; my $self = shift;
values %{$self->{_entries}} return values %{$self->{_entries}};
} }
1; 1;

View File

@ -19,6 +19,7 @@ sub run {
my $self = shift; my $self = shift;
# preserve older time stamp # preserve older time stamp
utime $self->{source}->{atime}, $self->{source}->{mtime}, $self->{target}->{name}; utime $self->{source}->{atime}, $self->{source}->{mtime}, $self->{target}->{name};
return;
} }
sub bytes_freed { sub bytes_freed {

View File

@ -21,7 +21,7 @@ sub new {
sub as_string { sub as_string {
my $self = shift; my $self = shift;
join "\n", $self->instructions; return join "\n", $self->instructions;
} }
sub buckets { sub buckets {
@ -55,7 +55,7 @@ sub buckets {
push @buckets, @these_buckets; push @buckets, @these_buckets;
} }
@buckets return @buckets;
} }
sub _entry_should_be_skipped { sub _entry_should_be_skipped {
@ -176,7 +176,7 @@ sub instructions {
); );
} }
} }
@inst return @inst;
} }
1; 1;

View File

@ -31,6 +31,7 @@ sub run {
if (--$self->{target}->{nlink} == 0) { if (--$self->{target}->{nlink} == 0) {
$self->{freed} = $self->{target}->{size}; $self->{freed} = $self->{target}->{size};
} }
return;
} }
sub bytes_freed { sub bytes_freed {

View File

@ -13,7 +13,7 @@ sub addcommas {
} }
push @added, (join '.', @parts); push @added, (join '.', @parts);
} }
wantarray ? @added : $added[0] return wantarray ? @added : $added[0];
} }
sub hr_size { sub hr_size {
@ -32,7 +32,7 @@ sub hr_size {
# default to ($sz, 'bytes') # default to ($sz, 'bytes')
@ret = ($sz, $sizes[0]) unless @ret; @ret = ($sz, $sizes[0]) unless @ret;
wantarray ? @ret : "@ret" return wantarray ? @ret : "@ret";
} }
sub shell_quote { sub shell_quote {
@ -43,7 +43,7 @@ sub shell_quote {
=~ s/'/'\\''/g; =~ s/'/'\\''/g;
"'$out'"; "'$out'";
} @words; } @words;
wantarray ? @transformed : $transformed[0]; return wantarray ? @transformed : $transformed[0];
} }
1; 1;

View File

@ -121,6 +121,7 @@ sub HELP_MESSAGE {
-verbose => 1, -verbose => 1,
-exitval => 0, -exitval => 0,
); );
return;
} }
MAIN: { MAIN: {

View File

@ -26,4 +26,5 @@ sub put_file {
print $fh 'A'; print $fh 'A';
} }
} }
return;
} }

View File

@ -1,4 +1,3 @@
# vi: et sts=4 sw=4 ts=4
use strict; use strict;
use warnings; use warnings;