[Python-checkins] cpython: Tweak the comments

raymond.hettinger python-checkins at python.org
Sat Aug 1 19:57:57 CEST 2015


https://hg.python.org/cpython/rev/0ad74e03e1b5
changeset:   97179:0ad74e03e1b5
user:        Raymond Hettinger <python at rcn.com>
date:        Sat Aug 01 10:57:42 2015 -0700
summary:
  Tweak the comments

files:
  Objects/setobject.c |  4 +++-
  1 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Objects/setobject.c b/Objects/setobject.c
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -763,7 +763,7 @@
     Py_uhash_t hash = 1927868237UL;
     setentry *entry;
 
-    /* Make hash(frozenset({0})) distinct from hash(frozenset()) */
+    /* Initial dispersion based on the number of active entries */
     hash *= (Py_uhash_t)PySet_GET_SIZE(self) + 1;
 
     /* Xor-in shuffled bits from every entry's hash field because xor is
@@ -790,8 +790,10 @@
     /* Disperse patterns arising in nested frozensets */
     hash = hash * 69069U + 907133923UL;
 
+    /* -1 is reserved as an error code */
     if (hash == (Py_uhash_t)-1)
         hash = 590923713UL;
+
     so->hash = hash;
     return hash;
 }

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list