Commit b335dfe7 authored by Raymond Hettinger's avatar Raymond Hettinger

Set the hash values of dummy entries to -1. Improves quality of entry->hash == hash tests.

parent 4d45c106
......@@ -337,6 +337,7 @@ set_discard_entry(PySetObject *so, setentry *oldentry)
return DISCARD_NOTFOUND;
old_key = entry->key;
entry->key = dummy;
entry->hash = -1;
so->used--;
Py_DECREF(old_key);
return DISCARD_FOUND;
......@@ -621,6 +622,7 @@ set_pop(PySetObject *so)
}
key = entry->key;
entry->key = dummy;
entry->hash = -1;
so->used--;
so->finger = i + 1; /* next place to start */
return key;
......
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