]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
dict_repr: Reuse one of the int vars (minor code simplification).
authorTim Peters <tim.peters@gmail.com>
Sat, 16 Jun 2001 07:52:53 +0000 (07:52 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 16 Jun 2001 07:52:53 +0000 (07:52 +0000)
Objects/dictobject.c

index 42bfd40213869d167a7ed9897b8e9dbf5053da2d..d8c93bce8d56c5954e46aced531931f80a7df713 100644 (file)
@@ -809,7 +809,7 @@ dict_print(register dictobject *mp, register FILE *fp, register int flags)
 static PyObject *
 dict_repr(dictobject *mp)
 {
-       int i, pos;
+       int i;
        PyObject *s, *temp, *colon = NULL;
        PyObject *pieces = NULL, *result = NULL;
        PyObject *key, *value;
@@ -834,8 +834,8 @@ dict_repr(dictobject *mp)
 
        /* Do repr() on each key+value pair, and insert ": " between them.
           Note that repr may mutate the dict. */
-       pos = 0;
-       while (PyDict_Next((PyObject *)mp, &pos, &key, &value)) {
+       i = 0;
+       while (PyDict_Next((PyObject *)mp, &i, &key, &value)) {
                int status;
                /* Prevent repr from deleting value during key format. */
                Py_INCREF(value);