From 1bc136acf9209844eb31bfef4dcee559f3683edb Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Thu, 23 Sep 2021 13:45:54 +0200 Subject: [PATCH] unicodey \a -> $a optimizations --- src/core.c/unicodey.pm6 | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/src/core.c/unicodey.pm6 b/src/core.c/unicodey.pm6 index ec2aed97e17..10798151a7e 100644 --- a/src/core.c/unicodey.pm6 +++ b/src/core.c/unicodey.pm6 @@ -703,39 +703,27 @@ multi sub uniprop-str(Int:D $code, Stringy:D $propname) { #?endif #?if !jvm -multi sub infix:(Str:D \a, Str:D \b) { - ORDER( - nqp::unicmp_s(nqp::unbox_s(a), nqp::unbox_s(b), 85,0,0) - ) +multi sub infix:(Str:D $a, Str:D $b) { + ORDER(nqp::unicmp_s($a,$b,85,0,0)) } -multi sub infix:(Cool:D \a, Cool:D \b) { - ORDER( - nqp::unicmp_s(nqp::unbox_s(a.Str), nqp::unbox_s(b.Str), 85,0,0) - ) +multi sub infix:(Cool:D $a, Cool:D $b) { + ORDER(nqp::unicmp_s($a.Str,$b.Str,85,0,0)) } -multi sub infix:(Pair:D \a, Pair:D \b) { - nqp::eqaddr((my $cmp := (a.key unicmp b.key)),Order::Same) - ?? (a.value unicmp b.value) +multi sub infix:(Pair:D $a, Pair:D $b) { + nqp::eqaddr((my $cmp := ($a.key unicmp $b.key)),Order::Same) + ?? ($a.value unicmp $b.value) !! $cmp } -multi sub infix:(Str:D \a, Str:D \b) { - ORDER( - nqp::unicmp_s( - nqp::unbox_s(a),nqp::unbox_s(b),$*COLLATION.collation-level,0,0 - ) - ) +multi sub infix:(Str:D $a, Str:D $b) { + ORDER(nqp::unicmp_s($a,$b,$*COLLATION.collation-level,0,0)) } -multi sub infix:(Cool:D \a, Cool:D \b) { - ORDER( - nqp::unicmp_s( - nqp::unbox_s(a.Str),nqp::unbox_s(b.Str),$*COLLATION.collation-level,0,0 - ) - ) +multi sub infix:(Cool:D $a, Cool:D $b) { + ORDER(nqp::unicmp_s($a.Str,$b.Str,$*COLLATION.collation-level,0,0)) } -multi sub infix:(Pair:D \a, Pair:D \b) { - nqp::eqaddr((my $cmp := (a.key coll b.key)),Order::Same) - ?? (a.value coll b.value) +multi sub infix:(Pair:D $a, Pair:D $b) { + nqp::eqaddr((my $cmp := ($a.key coll $b.key)),Order::Same) + ?? ($a.value coll $b.value) !! $cmp } #?endif