From c1c4a64edb1956befb757f8704e6b4f32e4a575e Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Sat, 17 Sep 2016 20:01:56 +0100 Subject: Issue #27111: Minor simplication to long_add and long_sub fast path code. Thanks Oren Milman. --- Objects/longobject.c | 8 ++------ 1 file 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) -- cgit v0.12