Skip to content
Permalink
Browse files

Ensure that enum eqv enum are also handled correctly

- because they maybe Ints as well (eg. Bool)
- makes Int eqv Int 2.8x slower
- but still almost 3x as fast compared to before fb9a045
  • Loading branch information...
lizmat committed Nov 1, 2018
1 parent 5120d3d commit 94dd0a411d53b25c047f1e0038114b811d920736
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/core/Int.pm6
@@ -295,7 +295,9 @@ multi sub infix:<*>(int $a, int $b --> int) {
}

multi sub infix:<eqv>(Int:D $a, Int:D $b --> Bool:D) {
nqp::hllbool(nqp::iseq_I($a,$b))
nqp::hllbool( # need to check types as enums such as Bool wind up here
nqp::eqaddr($a.WHAT,$b.WHAT) && nqp::iseq_I($a,$b)
)
}
multi sub infix:<eqv>(int $a, int $b --> Bool:D) {
nqp::hllbool(nqp::iseq_i($a,$b))

0 comments on commit 94dd0a4

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