diff options
author | Jack Lloyd <[email protected]> | 2018-12-05 21:45:06 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-12-05 21:45:06 -0500 |
commit | 6b22107d40dcd385d42d8ea1adfd1efa0b62626d (patch) | |
tree | a4df748d51e3add335e7e7d16b53cff4ac9c8f2b /src | |
parent | 7df693d6208fd499fea5d6748a7fff377851a3ce (diff) |
Avoid needless is_zero check in set_sign
If not negative we don't need to check the size
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/math/bigint/bigint.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/math/bigint/bigint.h b/src/lib/math/bigint/bigint.h index 9b7af4169..ee8f81719 100644 --- a/src/lib/math/bigint/bigint.h +++ b/src/lib/math/bigint/bigint.h @@ -553,10 +553,10 @@ class BOTAN_PUBLIC_API(2,0) BigInt final */ void set_sign(Sign sign) { - if(is_zero()) - m_signedness = Positive; - else - m_signedness = sign; + if(sign == Negative && is_zero()) + sign = Positive; + + m_signedness = sign; } /** |