diff options
author | Éric Araujo <merwok@netwok.org> | 2011-03-23 03:52:45 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-03-23 03:52:45 (GMT) |
commit | 83e7a2b7db047d70d29800a0f8d5c5beab5c936d (patch) | |
tree | 71b185d5d35b176d7b4734289d6c8a4e4838038c /Objects | |
parent | c28af1f05fbbfada68a0234ad5beeaf15892e0f2 (diff) | |
parent | bd626d4e84aa76226aa4a807df45978f2b59ae5c (diff) | |
download | cpython-83e7a2b7db047d70d29800a0f8d5c5beab5c936d.zip cpython-83e7a2b7db047d70d29800a0f8d5c5beab5c936d.tar.gz cpython-83e7a2b7db047d70d29800a0f8d5c5beab5c936d.tar.bz2 |
Merge from 3.2
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/setobject.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c index 478b5cb..48edad8 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -365,11 +365,12 @@ set_add_entry(register PySetObject *so, setentry *entry) { register Py_ssize_t n_used; PyObject *key = entry->key; + Py_hash_t hash = entry->hash; assert(so->fill <= so->mask); /* at least one empty slot */ n_used = so->used; Py_INCREF(key); - if (set_insert_key(so, key, entry->hash) == -1) { + if (set_insert_key(so, key, hash) == -1) { Py_DECREF(key); return -1; } @@ -639,6 +640,7 @@ set_merge(PySetObject *so, PyObject *otherset) { PySetObject *other; PyObject *key; + Py_hash_t hash; register Py_ssize_t i; register setentry *entry; @@ -660,10 +662,11 @@ set_merge(PySetObject *so, PyObject *otherset) for (i = 0; i <= other->mask; i++) { entry = &other->table[i]; key = entry->key; + hash = entry->hash; if (key != NULL && key != dummy) { Py_INCREF(key); - if (set_insert_key(so, key, entry->hash) == -1) { + if (set_insert_key(so, key, hash) == -1) { Py_DECREF(key); return -1; } |