]> granicus.if.org Git - python/commitdiff
Clarify comments on setentry invariants.
authorRaymond Hettinger <python@rcn.com>
Sat, 1 Aug 2015 22:21:41 +0000 (15:21 -0700)
committerRaymond Hettinger <python@rcn.com>
Sat, 1 Aug 2015 22:21:41 +0000 (15:21 -0700)
Include/setobject.h

index f17bc1b035457f874a8c68f2d82eb2b46888ca75..87ec1c8afc00c4b8262f5327f735960c1c1d939b 100644 (file)
@@ -10,12 +10,13 @@ extern "C" {
 
 /* There are three kinds of entries in the table:
 
-1. Unused:  key == NULL
-2. Active:  key != NULL and key != dummy
-3. Dummy:   key == dummy
+1. Unused:  key == NULL and hash == 0
+2. Dummy:   key == dummy and hash == -1
+3. Active:  key != NULL and key != dummy and hash != -1
 
-The hash field of Unused slots have no meaning.
-The hash field of Dummny slots are set to -1
+The hash field of Unused slots is always zero.
+
+The hash field of Dummy slots are set to -1
 meaning that dummy entries can be detected by
 either entry->key==dummy or by entry->hash==-1.
 */