Skip to content
Permalink
Browse files

Add shortcut for eqv of int / Int

- makes Int eqv Int about 8x as fast
- makes int eqv int about 5x as fast
- can now check allocation free
  • Loading branch information...
lizmat committed Nov 1, 2018
1 parent d964e8e commit fb9a0454c597f0521ac7c26c1586b0083780af16
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/core/Int.pm6
@@ -294,6 +294,13 @@ multi sub infix:<*>(int $a, int $b --> int) {
nqp::mul_i($a, $b);
}

multi sub infix:<eqv>(Int:D $a, Int:D $b --> Bool:D) {
nqp::hllbool(nqp::iseq_I($a,$b))
}
multi sub infix:<eqv>(int $a, int $b --> Bool:D) {
nqp::hllbool(nqp::iseq_i($a,$b))
}

multi sub infix:<div>(Int:D \a, Int:D \b) {
b
?? nqp::div_I(nqp::decont(a), nqp::decont(b), Int)

0 comments on commit fb9a045

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