[Python-checkins] cpython (merge 3.2 -> default): Merge from 3.2.

eric.araujo python-checkins at python.org
Wed Mar 23 04:54:03 CET 2011


http://hg.python.org/cpython/rev/85ffaa4e60e9
changeset:   68862:85ffaa4e60e9
parent:      68859:a364719e400a
parent:      68861:4fb6dfa8d08c
user:        Éric Araujo <merwok at netwok.org>
date:        Wed Mar 23 04:40:51 2011 +0100
summary:
  Merge from 3.2.

The fix was already present in 3.3, but I merged two small changes
recommended by Raymond while I was working on the 2.7 patch to ease
future merges.

files:
  

diff --git a/Objects/setobject.c b/Objects/setobject.c
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -365,11 +365,12 @@
 {
     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 @@
 {
     PySetObject *other;
     PyObject *key;
+    Py_hash_t hash;
     register Py_ssize_t i;
     register setentry *entry;
 
@@ -660,10 +662,11 @@
     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;
             }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list