From: Raymond Hettinger Date: Sat, 1 Aug 2015 17:57:42 +0000 (-0700) Subject: Tweak the comments X-Git-Tag: v3.6.0a1~1867 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36c0500990a383a47228855bae712595f7f5e1d5;p=thirdparty%2FPython%2Fcpython.git Tweak the comments --- diff --git a/Objects/setobject.c b/Objects/setobject.c index 2d4d8cde6f9d..d638c136651d 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -763,7 +763,7 @@ frozenset_hash(PyObject *self) 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 @@ frozenset_hash(PyObject *self) /* 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; }