Skip to content

Commit

Permalink
Fix RT #127803
Browse files Browse the repository at this point in the history
Definitely a case of premature optimization  :-)
  • Loading branch information
lizmat committed Aug 25, 2016
1 parent 6ae6ecb commit 7fa2ba7
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/core/Hash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,8 @@ my class Hash { # declared in BOOTSTRAP
my $last := @keys.pop;
my $hash = self;
$hash = $hash{$_} //= self.new for @keys;
nqp::push(
nqp::getattr(nqp::decont($hash{$last} //= []), List, '$!reified'),
&as ?? as($value) !! $value
);
($hash{$last} //= []).push(
&as ?? as($value) !! $value);
last if ($value := iter.pull-one) =:= IterationEnd;
$tested := test($value);
};
Expand All @@ -331,10 +329,7 @@ my class Hash { # declared in BOOTSTRAP
# simple classify to store a specific value
elsif &as {
loop {
nqp::push(
nqp::getattr(nqp::decont(self{$tested} //= []), List, '$!reified'),
as($value)
);
(self{$tested} //= []).push(as($value));
last if ($value := iter.pull-one) =:= IterationEnd;
$tested := test($value);
};
Expand All @@ -343,10 +338,7 @@ my class Hash { # declared in BOOTSTRAP
# just a simple classify
else {
loop {
nqp::push(
nqp::getattr(nqp::decont(self{$tested} //= []), List, '$!reified'),
$value
);
(self{$tested} //= []).push($value);
last if ($value := iter.pull-one) =:= IterationEnd;
$tested := test($value);
};
Expand Down

0 comments on commit 7fa2ba7

Please sign in to comment.