Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Over-engineer the watcher bits check
  • Loading branch information
carljm committed Oct 4, 2022
commit 6e5cee2a9ef5c6785498dc3dc3f6885d3fd8731f
3 changes: 2 additions & 1 deletion Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -5765,11 +5765,12 @@ _PyDict_SendEvent(int watcher_bits,
{
PyInterpreterState *interp = _PyInterpreterState_GET();
for (int i = 0; i < DICT_MAX_WATCHERS; i++) {
if (watcher_bits & (1 << i)) {
if (watcher_bits & 1) {
PyDict_WatchCallback cb = (PyDict_WatchCallback)interp->dict_watchers[i];
if (cb) {
cb(event, (PyObject*)mp, key, value);
}
}
watcher_bits >>= 1;
}
}