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; |     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}); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue