Skip to content

Commit 2fa09a9

Browse files
committed
Revert "gh-130327: Only set the managed dictionary if there aren't inline values"
This reverts commit 8a29421.
1 parent 671d3f7 commit 2fa09a9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Objects/dictobject.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7170,16 +7170,15 @@ set_dict_inline_values(PyObject *obj, PyDictObject *new_dict)
71707170

71717171
PyDictValues *values = _PyObject_InlineValues(obj);
71727172

7173+
Py_XINCREF(new_dict);
7174+
FT_ATOMIC_STORE_PTR(_PyObject_ManagedDictPointer(obj)->dict, new_dict);
7175+
71737176
if (values->valid) {
71747177
FT_ATOMIC_STORE_UINT8(values->valid, 0);
71757178
for (Py_ssize_t i = 0; i < values->capacity; i++) {
71767179
Py_CLEAR(values->values[i]);
71777180
}
71787181
}
7179-
else {
7180-
Py_XINCREF(new_dict);
7181-
FT_ATOMIC_STORE_PTR(_PyObject_ManagedDictPointer(obj)->dict, new_dict);
7182-
}
71837182
}
71847183

71857184
#ifdef Py_GIL_DISABLED

0 commit comments

Comments
 (0)