Skip to content

Commit

Permalink
Add native sub versions for .elems and .end
Browse files Browse the repository at this point in the history
- elems() about 4x as fast
- end() about 3x as fast
  • Loading branch information
lizmat committed Jul 8, 2022
1 parent af31b1d commit 4fedb6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core.c/native_array.pm6
Expand Up @@ -6532,4 +6532,7 @@ multi sub postcircumfix:<[ ]>(
#- PLEASE DON'T CHANGE ANYTHING ABOVE THIS LINE
#- end of shaped1 postcircumfix candidates of numarray -------------------------

multi sub elems(array:D \a) { nqp::elems(a) }
multi sub end(array:D \a) { nqp::sub_i(nqp::elems(a),1) }

# vim: expandtab shiftwidth=4

0 comments on commit 4fedb6f

Please sign in to comment.