mirror of
https://codeberg.org/h3xx/simplify_static_dir
synced 2024-08-14 23:57:24 +00:00
Refactor 'oldest_mtime' to be static
This commit is contained in:
parent
e5c25ef772
commit
5c6f506ed9
1 changed files with 6 additions and 5 deletions
|
@ -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});
|
||||
|
|
Loading…
Reference in a new issue