diff --git a/lib/Directory/Simplify/Instruction/Generator.pm b/lib/Directory/Simplify/Instruction/Generator.pm index 4f6c2ac..fdbd1d8 100644 --- a/lib/Directory/Simplify/Instruction/Generator.pm +++ b/lib/Directory/Simplify/Instruction/Generator.pm @@ -87,11 +87,12 @@ sub _entries_are_hard_linkable { return 0; } -sub oldest_mtime { - my $self = shift; - return sort { +sub _oldest_mtime { + my @entries = @_; + my @sorted = sort { $a->{mtime} <=> $b->{mtime} - } @_; + } @entries; + return @sorted; } sub more_linked { @@ -149,7 +150,7 @@ sub instructions { foreach my $bucket ($self->buckets) { # 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 my @to_link = $self->more_linked(@{$bucket});