summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-04-07 14:38:08 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-04-07 14:38:08 (GMT)
commit7eddd78a15bdd5f34b5dc1cc0929c99cfbe9339b (patch)
tree5b8f288194d9f03afae4cff92089270d85e28d7b /Python
parentd3b836d202a205492b6a27041e6d517dc3a2c615 (diff)
downloadcpython-7eddd78a15bdd5f34b5dc1cc0929c99cfbe9339b.zip
cpython-7eddd78a15bdd5f34b5dc1cc0929c99cfbe9339b.tar.gz
cpython-7eddd78a15bdd5f34b5dc1cc0929c99cfbe9339b.tar.bz2
Use continue instead of break whereever possible.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 9ea2772..49582dc 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1646,7 +1646,7 @@ eval_frame(PyFrameObject *f)
Py_DECREF(v);
}
}
- break;
+ continue;
case END_FINALLY:
v = POP();
@@ -1689,6 +1689,7 @@ eval_frame(PyFrameObject *f)
if ((x = f->f_locals) != NULL) {
err = PyDict_SetItem(x, w, v);
Py_DECREF(v);
+ if (err == 0) continue;
break;
}
PyErr_Format(PyExc_SystemError,
@@ -1719,6 +1720,8 @@ eval_frame(PyFrameObject *f)
Py_INCREF(w);
PUSH(w);
}
+ Py_DECREF(v);
+ continue;
} else if (PyList_CheckExact(v) && PyList_GET_SIZE(v) == oparg) {
PyObject **items = ((PyListObject *)v)->ob_item;
while (oparg--) {
@@ -1746,6 +1749,7 @@ eval_frame(PyFrameObject *f)
err = PyObject_SetAttr(v, w, u); /* v.w = u */
Py_DECREF(v);
Py_DECREF(u);
+ if (err == 0) continue;
break;
case DELETE_ATTR:
@@ -1761,6 +1765,7 @@ eval_frame(PyFrameObject *f)
v = POP();
err = PyDict_SetItem(f->f_globals, w, v);
Py_DECREF(v);
+ if (err == 0) continue;
break;
case DELETE_GLOBAL:
@@ -1835,7 +1840,7 @@ eval_frame(PyFrameObject *f)
}
Py_INCREF(x);
PUSH(x);
- break;
+ continue;
case DELETE_FAST:
x = GETLOCAL(oparg);
@@ -1854,6 +1859,7 @@ eval_frame(PyFrameObject *f)
x = freevars[oparg];
Py_INCREF(x);
PUSH(x);
+ if (x != NULL) continue;
break;
case LOAD_DEREF: