Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

be more robust when .count is Inf

but does not cover all cases yet
  • Loading branch information...
commit 11c0ab8869889cae763c3c4ad0f7480f87bc1dd3 1 parent b64c1e9
@moritz moritz authored
Showing with 4 additions and 4 deletions.
  1. +3 −3 src/core/List.pm
  2. +1 −1  src/core/MapIter.pm
View
6 src/core/List.pm
@@ -125,9 +125,9 @@ my class List does Positional {
method munch($n is copy) {
$n = 0 if $n < 0;
- self.gimme($n) if nqp::not_i(nqp::istype($n, Int))
- || nqp::not_i(nqp::islist($!items))
- || nqp::islt_i(nqp::elems($!items), nqp::unbox_i($n));
+ $n = self.gimme($n) if nqp::not_i(nqp::istype($n, Int))
+ || nqp::not_i(nqp::islist($!items))
+ || nqp::islt_i(nqp::elems($!items), nqp::unbox_i($n));
nqp::p6parcel(
pir::perl6_shiftpush__0PPi(nqp::list(), $!items, nqp::unbox_i($n)),
Any
View
2  src/core/MapIter.pm
@@ -22,7 +22,7 @@ my class MapIter is Iterator {
my $argc = $!block.count;
$argc = 1 if $argc < 1;
my $count;
- if nqp::istype($n, Whatever) {
+ if nqp::istype($n, Whatever) || $argc === $Inf {
$count = ($!list.gimme(*).Num / $argc).ceiling.Int
}
else {
Please sign in to comment.
Something went wrong with that request. Please try again.