Kaydet (Commit) 38418662 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Issue #26200: The SETREF macro adds unnecessary work in some cases.

üst 263c448a
......@@ -1218,6 +1218,7 @@ deque_del_item(dequeobject *deque, Py_ssize_t i)
static int
deque_ass_item(dequeobject *deque, Py_ssize_t i, PyObject *v)
{
PyObject *old_value;
block *b;
Py_ssize_t n, len=Py_SIZE(deque), halflen=(len+1)>>1, index=i;
......@@ -1246,7 +1247,9 @@ deque_ass_item(dequeobject *deque, Py_ssize_t i, PyObject *v)
b = b->leftlink;
}
Py_INCREF(v);
Py_SETREF(b->data[i], v);
old_value = b->data[i];
b->data[i] = v;
Py_DECREF(old_value);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment