Issue #27786: Simplify x_sub()

The z variable is known to be a fresh number which cannot be shared, Py_SIZE()
can be used directly to negate the number.
This commit is contained in:
Victor Stinner 2016-08-17 19:48:33 +02:00
parent 82df3b3071
commit 8bcf312d09
1 changed files with 1 additions and 3 deletions

View File

@ -3000,9 +3000,7 @@ x_sub(PyLongObject *a, PyLongObject *b)
}
assert(borrow == 0);
if (sign < 0) {
_PyLong_Negate(&z);
if (z == NULL)
return NULL;
Py_SIZE(z) = -Py_SIZE(z);
}
return long_normalize(z);
}