Message131821
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? |
|
Date |
User |
Action |
Args |
2011-03-23 00:20:49 | eric.araujo | set | recipients:
+ eric.araujo, rhettinger, abacabadabacaba |
2011-03-23 00:20:49 | eric.araujo | set | messageid: <1300839649.18.0.240749380559.issue8420@psf.upfronthosting.co.za> |
2011-03-23 00:20:47 | eric.araujo | link | issue8420 messages |
2011-03-23 00:20:47 | eric.araujo | create | |
|