Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make use of get_file_id

  • Loading branch information...
commit 0f13629fe97f592a945de5385d5332b9ad051242 1 parent f707378
@hoelzro hoelzro authored
Showing with 9 additions and 8 deletions.
  1. +7 −6 ConfigFinder.pm
  2. +2 −2 ack
View
13 ConfigFinder.pm
@@ -63,16 +63,17 @@ sub new {
sub _remove_redundancies {
my ( @configs ) = @_;
- my (%dev_and_inode_seen, %path_seen);
+ my %dev_and_inode_seen;
foreach my $path ( @configs ) {
my ( $dev, $inode ) = (stat $path)[0, 1];
- if( !defined($dev) || $path_seen{$path} ||
- ($inode && $dev_and_inode_seen{"$dev:$inode"} )) {
- undef $path;
- } else {
- $dev_and_inode_seen{"$dev:$inode"} = $path_seen{$path} = 1;
+ if( defined($dev) ) {
+ if( $dev_and_inode_seen{"$dev:$inode"} ) {
+ undef $path;
+ } else {
+ $dev_and_inode_seen{"$dev:$inode"} = 1;
+ }
}
}
return grep { defined() } @configs;
View
4 ack
@@ -120,10 +120,10 @@ sub _compile_file_filter {
my $inverse_filters = [ grep { $_->is_inverted() } @{$filters} ];
@{$filters} = grep { !$_->is_inverted() } @{$filters};
- my %is_member_of_starting_set = map { (File::Next::reslash($_) => 1) } @{$start};
+ my %is_member_of_starting_set = map { (App::Ack::get_file_id($_) => 1) } @{$start};
return sub {
- return 1 if $is_member_of_starting_set{ $File::Next::name };
+ return 1 if $is_member_of_starting_set{ App::Ack::get_file_id($File::Next::name) };
foreach my $filter (@ifiles_filters) {
my $resource = App::Ack::Resource::Basic->new($File::Next::name);
Please sign in to comment.
Something went wrong with that request. Please try again.