From 241da4c272d4252a9cf71c3f29230152c50ce205 Mon Sep 17 00:00:00 2001 From: xuxinhang Date: Fri, 24 Dec 2021 21:20:10 +0800 Subject: [PATCH] Revert: medium_value --- Objects/longobject.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Objects/longobject.c b/Objects/longobject.c index 3d78e7f51de96d..d8faaedea34111 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -32,9 +32,7 @@ static inline stwodigits medium_value(PyLongObject *x) { assert(IS_MEDIUM_VALUE(x)); - Py_ssize_t s = Py_SIZE(x); - stwodigits d = x->ob_digit[0]; - return s == 1 ? d : s == -1 ? -d : 0; + return ((stwodigits)Py_SIZE(x)) * x->ob_digit[0]; } #define IS_SMALL_INT(ival) (-_PY_NSMALLNEGINTS <= (ival) && (ival) < _PY_NSMALLPOSINTS)