Skip to content
Permalink
Browse files

Shortcut some []'s to nqp ops

  • Loading branch information...
lizmat committed Dec 26, 2018
1 parent 634633b commit 6392634ffbcfb3a39285aa89388a5a7874d62c23
Showing with 9 additions and 6 deletions.
  1. +6 −3 src/core/Cool.pm6
  2. +2 −2 src/core/Rakudo/Internals.pm6
  3. +1 −1 src/core/Supply.pm6
@@ -354,11 +354,14 @@ multi sub sprintf(Cool:D $format, *@args) {
}
}
Rakudo::Internals.initialize-sprintf-handler;
@args.elems;
nqp::p6box_s(
nqp::sprintf(nqp::unbox_s($format.Stringy),
nqp::clone(nqp::getattr(@args||[], List, '$!reified'))
nqp::sprintf(nqp::unbox_s($format.Stringy),
nqp::if(
@args.elems,
nqp::clone(nqp::getattr(@args,List,'$!reified')),
nqp::create(IterationBuffer)
)
)
)
}

@@ -503,7 +503,7 @@ my class Rakudo::Internals {
method sort(|c) { self.flat.sort(|c) }

multi method gist(::?CLASS:D:) {
self.gistseen('Array', { self!gist([], self.shape) })
self.gistseen('Array', { self!gist(nqp::create(Array),self.shape) })
}
method !gist(@path, @dims) {
if @dims.elems == 1 {
@@ -521,7 +521,7 @@ my class Rakudo::Internals {
~ '.new(:shape'
~ nqp::decont(self.shape).perl
~ ', '
~ self!perl([], self.shape)
~ self!perl(nqp::create(Array), self.shape)
~ ')'
~ (nqp::iscont(SELF) ?? '.item' !! '')
})
@@ -1252,7 +1252,7 @@ my class Supply does Awaitable {
return @s[0] if +@s == 1; # nothing to be done

supply {
my @values = [] xx +@s;
my @values = nqp::create(Array) xx +@s;
for @s.kv -> $index, $supply {
if &with {
whenever $supply -> \val {

0 comments on commit 6392634

Please sign in to comment.
You can’t perform that action at this time.