Skip to content

Commit

Permalink
Simplify &[cmp] lookup logic
Browse files Browse the repository at this point in the history
We know we're going to find one, so there's no need for the overhead
that INDIRECT_NAME_LOOKUP brings.
  • Loading branch information
lizmat committed Jul 29, 2021
1 parent fe4cc07 commit f84ff88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core.c/List.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -1327,8 +1327,10 @@ my class List does Iterable does Positional { # declared in BOOTSTRAP

Seq.new(nqp::isconcrete($!reified)
?? Rakudo::Iterator.ReifiedList(
nqp::eqaddr((my &by := CALLERS::('&infix:<cmp>')),&infix:<cmp>)
?? Rakudo::Sorting.MERGESORT-REIFIED-LIST($List)
nqp::eqaddr(
(my &by := CALLERS::.AT-KEY('&infix:<cmp>')),
&infix:<cmp>
) ?? Rakudo::Sorting.MERGESORT-REIFIED-LIST($List)
!! Rakudo::Sorting.MERGESORT-REIFIED-LIST-WITH($List, &by)
)
!! Rakudo::Iterator.Empty
Expand Down

0 comments on commit f84ff88

Please sign in to comment.