diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-08-17 19:48:33 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-08-17 19:48:33 +0200 |
commit | 8bcf312d093cd90ca65b329d3f97ec2a1304c5b3 (patch) | |
tree | 47799a8f87cbc220bc4e051f738f7526eb3cd893 /Objects/longobject.c | |
parent | 82df3b3071bb003247c33eac4670775e9883c994 (diff) | |
download | cpython-git-8bcf312d093cd90ca65b329d3f97ec2a1304c5b3.tar.gz |
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.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 4 |
1 files changed, 1 insertions, 3 deletions
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); } |