Refactor 'oldest_mtime' to be static

This commit is contained in:
Dan Church 2023-07-20 12:48:07 -05:00
parent e5c25ef772
commit 5c6f506ed9
Signed by: h3xx
GPG key ID: EA2BF379CD2CDBD0

View file

@ -87,11 +87,12 @@ sub _entries_are_hard_linkable {
return 0; return 0;
} }
sub oldest_mtime { sub _oldest_mtime {
my $self = shift; my @entries = @_;
return sort { my @sorted = sort {
$a->{mtime} <=> $b->{mtime} $a->{mtime} <=> $b->{mtime}
} @_; } @entries;
return @sorted;
} }
sub more_linked { sub more_linked {
@ -149,7 +150,7 @@ sub instructions {
foreach my $bucket ($self->buckets) { foreach my $bucket ($self->buckets) {
# of the bucket, find the oldest timestamp # of the bucket, find the oldest timestamp
my ($oldest_entry) = $self->oldest_mtime(@{$bucket}); my ($oldest_entry) = _oldest_mtime(@{$bucket});
# of the bucket, find the file most embedded in the file system # of the bucket, find the file most embedded in the file system
my @to_link = $self->more_linked(@{$bucket}); my @to_link = $self->more_linked(@{$bucket});