Skip to content
Permalink
Browse files

empty array at start of STORE

so that assigning a Seq into a native array won't
make it grow more and more each time
  • Loading branch information...
timo committed Nov 18, 2018
1 parent 0d5a813 commit f1fa5adfff114757cb7c1e76c506f1d02f6d48e5
Showing with 7 additions and 3 deletions.
  1. +6 −3 src/core/native_array.pm6
  2. +1 −0 tools/build/makeNATIVE_ARRAY.p6
@@ -89,7 +89,7 @@ my class array does Iterable {

my role strarray[::T] does Positional[T] is array_type(T) {
#- start of generated part of strarray role -----------------------------------
#- Generated on 2018-09-15T11:00:21+02:00 by tools/build/makeNATIVE_ARRAY.p6
#- Generated on 2018-11-18T17:27:23+01:00 by tools/build/makeNATIVE_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE

multi method AT-POS(strarray:D: int $idx) is raw {
@@ -135,6 +135,7 @@ my class array does Iterable {
:action<store>, :what(self.^name)
).throw,
nqp::stmts(
nqp::setelems(self,0),
$iterator.push-all(self),
self
)
@@ -572,7 +573,7 @@ my class array does Iterable {

my role intarray[::T] does Positional[T] is array_type(T) {
#- start of generated part of intarray role -----------------------------------
#- Generated on 2018-09-15T11:00:21+02:00 by tools/build/makeNATIVE_ARRAY.p6
#- Generated on 2018-11-18T17:27:23+01:00 by tools/build/makeNATIVE_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE

multi method AT-POS(intarray:D: int $idx) is raw {
@@ -618,6 +619,7 @@ my class array does Iterable {
:action<store>, :what(self.^name)
).throw,
nqp::stmts(
nqp::setelems(self,0),
$iterator.push-all(self),
self
)
@@ -1107,7 +1109,7 @@ my class array does Iterable {

my role numarray[::T] does Positional[T] is array_type(T) {
#- start of generated part of numarray role -----------------------------------
#- Generated on 2018-09-15T11:00:21+02:00 by tools/build/makeNATIVE_ARRAY.p6
#- Generated on 2018-11-18T17:27:23+01:00 by tools/build/makeNATIVE_ARRAY.p6
#- PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE

multi method AT-POS(numarray:D: int $idx) is raw {
@@ -1153,6 +1155,7 @@ my class array does Iterable {
:action<store>, :what(self.^name)
).throw,
nqp::stmts(
nqp::setelems(self,0),
$iterator.push-all(self),
self
)
1 tools/build/makeNATIVE_ARRAY.p6 100755 → 100644
@@ -92,6 +92,7 @@ for $*IN.lines -> $line {
:action<store>, :what(self.^name)
).throw,
nqp::stmts(
nqp::setelems(self,0),
$iterator.push-all(self),
self
)

0 comments on commit f1fa5ad

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