diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2016-09-17 19:01:56 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2016-09-17 19:01:56 (GMT) |
commit | c1c4a64edb1956befb757f8704e6b4f32e4a575e (patch) | |
tree | b71b09fecacb08d9ecb619ebcfe53ece55c02e25 /Objects/longobject.c | |
parent | fba121fe9d8fa71f5f6eea465165dbda659915ad (diff) | |
download | cpython-c1c4a64edb1956befb757f8704e6b4f32e4a575e.zip cpython-c1c4a64edb1956befb757f8704e6b4f32e4a575e.tar.gz cpython-c1c4a64edb1956befb757f8704e6b4f32e4a575e.tar.bz2 |
Issue #27111: Minor simplication to long_add and long_sub fast path code. Thanks Oren Milman.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 0ecbab1..6e569b2 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -3103,9 +3103,7 @@ long_add(PyLongObject *a, PyLongObject *b) CHECK_BINOP(a, b); if (Py_ABS(Py_SIZE(a)) <= 1 && Py_ABS(Py_SIZE(b)) <= 1) { - PyObject *result = PyLong_FromLong(MEDIUM_VALUE(a) + - MEDIUM_VALUE(b)); - return result; + return PyLong_FromLong(MEDIUM_VALUE(a) + MEDIUM_VALUE(b)); } if (Py_SIZE(a) < 0) { if (Py_SIZE(b) < 0) { @@ -3139,9 +3137,7 @@ long_sub(PyLongObject *a, PyLongObject *b) CHECK_BINOP(a, b); if (Py_ABS(Py_SIZE(a)) <= 1 && Py_ABS(Py_SIZE(b)) <= 1) { - PyObject* r; - r = PyLong_FromLong(MEDIUM_VALUE(a)-MEDIUM_VALUE(b)); - return r; + return PyLong_FromLong(MEDIUM_VALUE(a) - MEDIUM_VALUE(b)); } if (Py_SIZE(a) < 0) { if (Py_SIZE(b) < 0) |