From: Mark Dickinson Date: Sat, 17 Sep 2016 18:44:13 +0000 (+0100) Subject: Issue #27441: Remove some redundant assignments to ob_size in longobject.c. Thanks... X-Git-Tag: v3.7.0a1~2457 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fba121fe9d8fa71f5f6eea465165dbda659915ad;p=python Issue #27441: Remove some redundant assignments to ob_size in longobject.c. Thanks Oren Milman. --- diff --git a/Misc/NEWS b/Misc/NEWS index a4da86489c..088dfa941d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.7.0 alpha 1 Core and Builtins ----------------- +- Issue #27441: Remove some redundant assignments to ob_size in longobject.c. + Thanks Oren Milman. + - Issue #27222: Clean up redundant code in long_rshift function. Thanks Oren Milman. diff --git a/Objects/longobject.c b/Objects/longobject.c index 0822f9bcb3..0ecbab1fba 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -315,7 +315,6 @@ PyLong_FromUnsignedLong(unsigned long ival) v = _PyLong_New(ndigits); if (v != NULL) { digit *p = v->ob_digit; - Py_SIZE(v) = ndigits; while (ival) { *p++ = (digit)(ival & PyLong_MASK); ival >>= PyLong_SHIFT; @@ -1102,7 +1101,6 @@ PyLong_FromUnsignedLongLong(unsigned long long ival) v = _PyLong_New(ndigits); if (v != NULL) { digit *p = v->ob_digit; - Py_SIZE(v) = ndigits; while (ival) { *p++ = (digit)(ival & PyLong_MASK); ival >>= PyLong_SHIFT;