Skip to content

Commit

Permalink
Revert "Remove to unnecessary return statements"
Browse files Browse the repository at this point in the history
This reverts commit 730c5a1.
  • Loading branch information
lizmat committed Apr 21, 2020
1 parent 730c5a1 commit ef7dd18
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/core.c/Hyper.pm6
Expand Up @@ -58,10 +58,9 @@ class Hyper {

# %x >>op<< y
multi method infix(Associative:D \left, \right --> Associative:D) {
if nqp::istype(left,Pair) {
self!pair-mu(left,right)
}
elsif $!assigns {
return self!pair-mu(left,right) if nqp::istype(left,Pair);

if $!assigns {
self.infix(left.values,right);
left
}
Expand All @@ -82,17 +81,14 @@ class Hyper {

# x >>op<< %y
multi method infix(\left, Associative:D \right --> Associative:D) {
if nqp::istype(right,Pair) {
self!mu-pair(left,right)
}
else {
my \result := nqp::create(right.WHAT).STORE(
right.keys,
self.infix(left,right.values),
:INITIALIZE
);
nqp::iscont(right) ?? result.item !! result;
}
return self!mu-pair(left,right) if nqp::istype(right,Pair);

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

# [x] >>op<< y
Expand Down

0 comments on commit ef7dd18

Please sign in to comment.