Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A temporary fix for faster module loading
*All* directories and *all* types were being checked, whereas always only the
first was being used.  This quick fix short-circuits search as soon as the
first candidate is found.
  • Loading branch information
lizmat committed May 19, 2013
1 parent 2a04f23 commit af2b6ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Perl6/ModuleLoader.nqp
Expand Up @@ -96,18 +96,21 @@ class Perl6::ModuleLoader {
%cand<load> := "$prefix/$pbc_path";
}
@candidates.push(%cand);
+last; # temporary, until we actually don't do just @candidates[0]
}
elsif $have_pir {
my %cand;
%cand<key> := "$prefix/$pir_path";
%cand<load> := "$prefix/$pir_path";
@candidates.push(%cand);
+last; # temporary, until we actually don't do just @candidates[0]
}
elsif $have_pbc {
my %cand;
%cand<key> := "$prefix/$pbc_path";
%cand<load> := "$prefix/$pbc_path";
@candidates.push(%cand);
+last; # temporary, until we actually don't do just @candidates[0]
}
}
}
Expand Down

0 comments on commit af2b6ce

Please sign in to comment.