Simplify big.Int comparisons to zero

This commit is contained in:
Nigel Tao committed 2018-01-04 11:08:41 +11:00
1 parent 8a986019f8
commit 0b06dbcf02
3 files changed
+20 -20

No files matched your search

+1 -1
View File
@@ -119,7 +119,7 @@ check1:
if lhs := x.LHS().Expr(); !lhs.Eq(d) {
continue
}
if rcv := x.RHS().Expr().ConstValue(); rcv == nil || rcv.Cmp(zero) != 0 {
if rcv := x.RHS().Expr().ConstValue(); rcv == nil || rcv.Sign() != 0 {
continue
}
break check1