mercurial/dirs.c
changeset 25016 42e89b87ca79
parent 25015 b3a68fb8b859
child 25092 f41539418b41
--- a/mercurial/dirs.c	Fri May 08 15:09:28 2015 -0700
+++ b/mercurial/dirs.c	Fri May 08 15:04:14 2015 -0700
@@ -69,7 +69,7 @@
 		val = PyDict_GetItem(dirs, key);
 		if (val != NULL) {
 			PyInt_AS_LONG(val) += 1;
-			continue;
+			break;
 		}
 
 		/* Force Python to not reuse a small shared int. */
@@ -114,9 +114,11 @@
 			goto bail;
 		}
 
-		if (--PyInt_AS_LONG(val) <= 0 &&
-		    PyDict_DelItem(dirs, key) == -1)
-			goto bail;
+		if (--PyInt_AS_LONG(val) <= 0) {
+			if (PyDict_DelItem(dirs, key) == -1)
+				goto bail;
+		} else
+			break;
 		Py_CLEAR(key);
 	}
 	ret = 0;