From: Victor Stinner Date: Wed, 17 Aug 2016 17:48:33 +0000 (+0200) Subject: Issue #27786: Simplify x_sub() X-Git-Tag: v3.6.0b1~679 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bcf312d093cd90ca65b329d3f97ec2a1304c5b3;p=python 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. --- diff --git a/Objects/longobject.c b/Objects/longobject.c index d49594d129..4b2b6021a9 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -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); }