Permalink
Browse files

next LABEL seems to be more expensive than last

  • Loading branch information...
lizmat committed Jun 29, 2014
1 parent 8ed248e commit b80cf18535e52199ddf3f8d5119fb12faeb46738
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/core/CompUnitRepo/Local/File.pm
@@ -15,20 +15,19 @@ class CompUnitRepo::Local::File does CompUnitRepo::Locally {
my @candidates;
my %seen;
FILES:
for $!path.contents -> $path {
my $file = ~$path;
for $file.rindex(".") -> $i {
next FILES unless $i.defined; # could not find any extension
last unless $i.defined; # could not find any extension
my $ext = $file.substr($i + 1);
next FILES unless $ext ~~ $anyextensions; # not right ext
last unless $ext ~~ $anyextensions; # not right ext
my $root = $file.substr(0,$i);
my $j := $root.rindex(IO::Spec.rootdir);
$root = $root.substr($j + 1) if $j.defined;
next FILES unless $root ~~ $name; # not right name
last unless $root ~~ $name; # not right name
if %seen{$root} -> $seenroot { # seen name before
$seenroot{$ext} := \($file, :name($root) );

0 comments on commit b80cf18

Please sign in to comment.