Skip to content

Commit ad71fab

Browse files
committed
Edit comment and remove early returns
1 parent 5f2ab56 commit ad71fab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Objects/dictobject.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7414,17 +7414,16 @@ PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg)
74147414
PyDictObject *dict = _PyObject_ManagedDictPointer(obj)->dict;
74157415
if (dict != NULL) {
74167416
// GH-130327: If there's a managed dictionary available, we should
7417-
// *always* traverse it, including when inline values are available.
7417+
// *always* traverse it. The dict is responsible for traversing the
7418+
// inline values if it points to them.
74187419
Py_VISIT(dict);
7419-
return 0;
74207420
}
7421-
if (tp->tp_flags & Py_TPFLAGS_INLINE_VALUES) {
7421+
else if (tp->tp_flags & Py_TPFLAGS_INLINE_VALUES) {
74227422
PyDictValues *values = _PyObject_InlineValues(obj);
74237423
if (values->valid) {
74247424
for (Py_ssize_t i = 0; i < values->capacity; i++) {
74257425
Py_VISIT(values->values[i]);
74267426
}
7427-
return 0;
74287427
}
74297428
}
74307429
return 0;

0 commit comments

Comments
 (0)