Skip to content

Commit

Permalink
Streamline CU::RepositoryRegistry.setup-repositories
Browse files Browse the repository at this point in the history
- part 3
- move initial $next-repo initialization into non-precomp if
  so we need to check that condition one time less
  • Loading branch information
lizmat committed Mar 11, 2020
1 parent 437f9f4 commit 6e95e1b
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/core.c/CompUnit/RepositoryRegistry.pm6
Expand Up @@ -72,10 +72,12 @@ class CompUnit::RepositoryRegistry {
my $precomp-specs :=
nqp::ifnull(nqp::atkey($ENV,'RAKUDO_PRECOMP_WITH'),False);

my CompUnit::Repository $next-repo;

# starting up for creating precomp
if $precomp-specs {
# assume well formed strings
$raw-specs := nqp::split(',', $precomp-specs);
$raw-specs := nqp::split(',',$precomp-specs);
}

# normal start up
Expand All @@ -95,6 +97,17 @@ class CompUnit::RepositoryRegistry {
if nqp::atkey($ENV,'PERL6LIB') -> $specs {
nqp::push($raw-specs,$_) for parse-include-specS($specs);
}

# your basic repo chain
$next-repo := CompUnit::Repository::AbsolutePath.new(
:next-repo(CompUnit::Repository::NQP.new(
:next-repo(CompUnit::Repository::Perl5.new(
#?if jvm
:next-repo(CompUnit::Repository::JavaRuntime.new)
#?endif
))
))
);
}

my str $prefix = nqp::ifnull(
Expand Down Expand Up @@ -126,18 +139,6 @@ class CompUnit::RepositoryRegistry {
my str $vendor = 'inst#' ~ $prefix ~ $sep ~ 'vendor';
my str $core = 'inst#' ~ $prefix ~ $sep ~ 'core';

# your basic repo chain
my CompUnit::Repository $next-repo;
$next-repo := CompUnit::Repository::AbsolutePath.new(
:next-repo(CompUnit::Repository::NQP.new(
:next-repo(CompUnit::Repository::Perl5.new(
#?if jvm
:next-repo(CompUnit::Repository::JavaRuntime.new)
#?endif
))
))
) unless $precomp-specs;

# create reverted, unique list of path-specs
my $unique := nqp::hash();
my $specs := nqp::list();
Expand Down

0 comments on commit 6e95e1b

Please sign in to comment.