[Python-checkins] python/dist/src/Objects dictobject.c,2.162,2.163

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Sun Feb 6 00:43:09 CET 2005


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31379

Modified Files:
	dictobject.c 
Log Message:
Code simplification -- eliminate lookup when value is known in advance.

Index: dictobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v
retrieving revision 2.162
retrieving revision 2.163
diff -u -d -r2.162 -r2.163
--- dictobject.c	15 Jul 2004 15:54:04 -0000	2.162
+++ dictobject.c	5 Feb 2005 23:42:57 -0000	2.163
@@ -400,8 +400,10 @@
 	else {
 		if (ep->me_key == NULL)
 			mp->ma_fill++;
-		else
-			Py_DECREF(ep->me_key);
+		else {
+			assert(ep->me_key == dummy);
+			Py_DECREF(dummy);
+		}
 		ep->me_key = key;
 		ep->me_hash = hash;
 		ep->me_value = value;



More information about the Python-checkins mailing list