From 8bcf312d093cd90ca65b329d3f97ec2a1304c5b3 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 17 Aug 2016 19:48:33 +0200 Subject: [PATCH] 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. --- Objects/longobject.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Objects/longobject.c b/Objects/longobject.c index d49594d1292..4b2b6021a9c 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); }