Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix lookup of potential comp unit candidates
In case we have already seen a basename of a candidate we dropped
additional candidates. Therefor we missed a precompiled cu when we
already had seen a source file. Since the content of a directory
is not ordered the result depended on the phase of the moon, mostly.
  • Loading branch information
FROGGS committed Jul 8, 2014
1 parent 3062bc1 commit 3397a71
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/core/CompUnitRepo/Local/File.pm
Expand Up @@ -38,6 +38,7 @@ class CompUnitRepo::Local::File does CompUnitRepo::Locally {
for $!path.contents -> $path {
my $file = ~$path;

# We loop over one element to be able to 'last' out ot if.
for $file.rindex(".") -> $i {
last unless $i.defined; # could not find any ext

Expand All @@ -48,13 +49,7 @@ class CompUnitRepo::Local::File does CompUnitRepo::Locally {
my $j := $root.rindex(IO::Spec.rootdir);
$root = $root.substr($j + 1) if $j.defined;

if $potentials{$root} -> $seenroot { # seen name before
$potentials{$ext} := \($file, :name($root) );
}

else { # first time
$potentials{$root}{$ext} := \($file, :name($root) );
}
$potentials{$root}{$ext} := \($file, :name($root) );
}
}
$potentials;
Expand Down

0 comments on commit 3397a71

Please sign in to comment.