Skip to content
Permalink
Browse files

foo

  • Loading branch information...
lizmat committed Nov 16, 2018
1 parent dc67ee7 commit cae9847e46056635e896388228772d4a4c846fc5
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/core/Hyper.pm6
@@ -53,10 +53,9 @@ class Hyper {
left
}
else {
my @keys is List = left.keys;
my \result := nqp::create(left.WHAT).STORE(
@keys,
self.infix(left{@keys},right),
left.keys,
self.infix(left.values,right),
:INITIALIZE
);
nqp::iscont(left) ?? result.item !! result;
@@ -73,10 +72,9 @@ class Hyper {
multi method infix(\left, Associative:D \right --> Associative:D) {
return self!mu-pair(left,right) if nqp::istype(right,Pair);

my @keys is List = right.keys;
my \result := nqp::create(right.WHAT).STORE(
@keys,
self.infix(left,right{@keys}),
right.keys,
self.infix(left,right.values),
:INITIALIZE
);
nqp::iscont(right) ?? result.item !! result;

1 comment on commit cae9847

@lizmat

This comment has been minimized.

Copy link
Contributor Author

commented on cae9847 Nov 16, 2018

Commit message should have read:

Don't create the list of keys beforehand, as the .keys and .values functions are guaranteed to have the same order while the structure of the hash is untouched.

Please sign in to comment.
You can’t perform that action at this time.