diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-09-02 22:12:49 +0200 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2015-09-02 22:12:49 +0200 |
commit | ba64e826f46b306ab837eec4c8e6dd88bff98254 (patch) | |
tree | dce74d797728c970b40e516dec332df9c43d6d8a /mpq | |
parent | f3dd005293cda84f6779abfec77c0050ae56ed49 (diff) | |
download | gmp-ba64e826f46b306ab837eec4c8e6dd88bff98254.tar.gz |
mpq/div.c: Move a branch out of the normal flow.
Diffstat (limited to 'mpq')
-rw-r--r-- | mpq/div.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -47,17 +47,17 @@ mpq_div (mpq_ptr quot, mpq_srcptr op1, mpq_srcptr op2) if (UNLIKELY (op2_size == 0)) DIVIDE_BY_ZERO; - if (op1 == op2) + if (UNLIKELY (quot == op2)) { - PTR(NUM(quot))[0] = 1; - SIZ(NUM(quot)) = 1; - PTR(DEN(quot))[0] = 1; - SIZ(DEN(quot)) = 1; - return; - } + if (op1 == op2) + { + PTR(NUM(quot))[0] = 1; + SIZ(NUM(quot)) = 1; + PTR(DEN(quot))[0] = 1; + SIZ(DEN(quot)) = 1; + return; + } - if (quot == op2) - { /* We checked for op1 == op2: we are not in the x=x/x case. We compute x=y/x by computing x=inv(x)*y */ MPN_PTR_SWAP (PTR(NUM(quot)), ALLOC(NUM(quot)), |