summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-06-16 07:52:53 +0000
committerTim Peters <tim.peters@gmail.com>2001-06-16 07:52:53 +0000
commitb015fc51270cc264a38640a62e28449267413240 (patch)
tree506f723c5a88a6a8f2a957de1893832952c59b0c
parent8027370cb61e1ce7015721d01747e250fae27f99 (diff)
downloadcpython-b015fc51270cc264a38640a62e28449267413240.tar.gz
dict_repr: Reuse one of the int vars (minor code simplification).
-rw-r--r--Objects/dictobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 42bfd40213..d8c93bce8d 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -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);