Skip to content

Commit

Permalink
Get rid of =:= in IterateMoreWithPhasers
Browse files Browse the repository at this point in the history
This is the iterator used for things like:
  for @foo -> $k, $v { PHASER foo }
Should have some positive effect on performance.
  • Loading branch information
lizmat committed Mar 27, 2018
1 parent c41b79c commit 0756076
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/Any-iterable-methods.pm6
Expand Up @@ -688,11 +688,13 @@ Did you mean to add a stub (\{...\}) or did you mean to .classify?"
if &!block.has-phaser('FIRST');
}

if $!slipping && !(($result := self.slip-one()) =:= IterationEnd) {
if $!slipping && nqp::not_i(
nqp::eqaddr(($result := self.slip-one),IterationEnd)) {
# $result will be returned at the end
}
elsif $!source.push-exactly($!value-buffer, $!count) =:= IterationEnd
&& nqp::elems($!value-buffer) == 0 {
elsif nqp::eqaddr(
$!source.push-exactly($!value-buffer,$!count),IterationEnd)
&& nqp::elems($!value-buffer) == 0 {
$result := IterationEnd
}
else {
Expand Down

0 comments on commit 0756076

Please sign in to comment.