[Python-checkins] cpython: Issue #27441: Remove some redundant assignments to ob_size in longobject.c.

mark.dickinson python-checkins at python.org
Sat Sep 17 14:44:25 EDT 2016


https://hg.python.org/cpython/rev/27a6ecf84f72
changeset: 103885:27a6ecf84f72
user: Mark Dickinson <dickinsm at gmail.com>
date: Sat Sep 17 19:44:13 2016 +0100
summary:
 Issue #27441: Remove some redundant assignments to ob_size in longobject.c. Thanks Oren Milman.
files:
 Misc/NEWS | 3 +++
 Objects/longobject.c | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@
 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
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -315,7 +315,6 @@
 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 @@
 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;
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /