Skip to content

Commit

Permalink
Simplify Hash.roll(N)
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 8, 2018
1 parent 12bd328 commit f0b705c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/Hash.pm6
Expand Up @@ -702,8 +702,7 @@ my class Hash { # declared in BOOTSTRAP
multi method roll(::?CLASS:D: Whatever $) { self.roll(Inf) }
multi method roll(::?CLASS:D: $count) {
Seq.new(nqp::if(
(my $raw := nqp::getattr(self,Map,'$!storage'))
&& nqp::elems($raw) && $count > 0,
$count > 0 && nqp::elems(nqp::getattr(self,Map,'$!storage')),
class :: does Iterator {
has $!storage;
has $!keys;
Expand Down

0 comments on commit f0b705c

Please sign in to comment.