]> granicus.if.org Git - python/commitdiff
Fix nits.
authorRaymond Hettinger <python@rcn.com>
Wed, 17 Aug 2005 02:19:36 +0000 (02:19 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 17 Aug 2005 02:19:36 +0000 (02:19 +0000)
Objects/dictobject.c

index aaca5aa4c1dae36d91336fb75b759bef72bb5b95..e90aca4b0fd4602200449c9cc205612141b12471 100644 (file)
@@ -113,7 +113,7 @@ equally good collision statistics, needed less code & used less memory.
 */
 
 /* Object used as dummy key to fill deleted entries */
-static PyObject *dummy; /* Initialized by first call to newdictobject() */
+static PyObject *dummy = NULL; /* Initialized by first call to newdictobject() */
 
 /* forward declarations */
 static dictentry *
@@ -567,7 +567,7 @@ PyDict_SetItem(register PyObject *op, PyObject *key, PyObject *value)
         */
        if (!(mp->ma_used > n_used && mp->ma_fill*3 >= (mp->ma_mask+1)*2))
                return 0;
-       return dictresize(mp, mp->ma_used*(mp->ma_used>50000 ? 2 : 4));
+       return dictresize(mp, (mp->ma_used>50000 ? mp->ma_used*2 : mp->ma_used*4));
 }
 
 int