Skip to content

Commit

Permalink
Avoid two Scalar allocations in various Rat ops
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Apr 4, 2018
1 parent 5981f81 commit 7c51061
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Rat.pm6
Expand Up @@ -60,8 +60,8 @@ sub DIVIDE_NUMBERS(Int:D \nu, Int:D \de, \t1, \t2) {
nqp::p6box_n(nqp::div_In($numerator, $denominator)))))
}

sub DON'T_DIVIDE_NUMBERS(Int:D \nu, Int:D \de, $t1, $t2) {
nqp::istype($t1, FatRat) || nqp::istype($t2, FatRat)
sub DON'T_DIVIDE_NUMBERS(Int:D \nu, Int:D \de, \t1, \t2) {
nqp::istype(t1, FatRat) || nqp::istype(t2, FatRat)
?? nqp::p6bindattrinvres(
nqp::p6bindattrinvres(
nqp::create(FatRat),
Expand Down

0 comments on commit 7c51061

Please sign in to comment.