Skip to content

Commit 6e5cee2

Browse files
committed
Over-engineer the watcher bits check
1 parent 1c7f814 commit 6e5cee2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/dictobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5765,11 +5765,12 @@ _PyDict_SendEvent(int watcher_bits,
57655765
{
57665766
PyInterpreterState *interp = _PyInterpreterState_GET();
57675767
for (int i = 0; i < DICT_MAX_WATCHERS; i++) {
5768-
if (watcher_bits & (1 << i)) {
5768+
if (watcher_bits & 1) {
57695769
PyDict_WatchCallback cb = (PyDict_WatchCallback)interp->dict_watchers[i];
57705770
if (cb) {
57715771
cb(event, (PyObject*)mp, key, value);
57725772
}
57735773
}
5774+
watcher_bits >>= 1;
57745775
}
57755776
}

0 commit comments

Comments
 (0)