Éric Araujo <mer...@netwok.org> added the comment:

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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8420>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to