This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients abacabadabacaba, eric.araujo, rhettinger
Date 2011-03-23.00:20:47
SpamBayes Score 0.00015802607
Marked as misclassified No
Message-id <1300839649.18.0.240749380559.issue8420@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a part of my 3.1 patch:

+    PyObject *key = entry->key;
+    long hash = entry->hash;

     assert(so->fill <= so->mask);  /* at least one empty slot */
     n_used = so->used;
-    Py_INCREF(entry->key);
-    if (set_insert_key(so, entry->key, (long) entry->hash) == -1) {
-        Py_DECREF(entry->key);
+    Py_INCREF(key);
+    if (set_insert_key(so, key, hash) == -1) {
+        Py_DECREF(key);

You’ll notice that I declare hash as long, but I don’t need to cast it to long to make it compile and run.  However, the previous code did cast; was that done on purpose, maybe for 32-bit platforms, or is it okay to not have the cast?
History
Date User Action Args
2011-03-23 00:20:49eric.araujosetrecipients: + eric.araujo, rhettinger, abacabadabacaba
2011-03-23 00:20:49eric.araujosetmessageid: <1300839649.18.0.240749380559.issue8420@psf.upfronthosting.co.za>
2011-03-23 00:20:47eric.araujolinkissue8420 messages
2011-03-23 00:20:47eric.araujocreate