Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7eddd78

Browse files
committed
Use continue instead of break whereever possible.
1 parent d3b836d commit 7eddd78

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

Python/ceval.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ eval_frame(PyFrameObject *f)
16461646
Py_DECREF(v);
16471647
}
16481648
}
1649-
break;
1649+
continue;
16501650

16511651
case END_FINALLY:
16521652
v = POP();
@@ -1689,6 +1689,7 @@ eval_frame(PyFrameObject *f)
16891689
if ((x = f->f_locals) != NULL) {
16901690
err = PyDict_SetItem(x, w, v);
16911691
Py_DECREF(v);
1692+
if (err == 0) continue;
16921693
break;
16931694
}
16941695
PyErr_Format(PyExc_SystemError,
@@ -1719,6 +1720,8 @@ eval_frame(PyFrameObject *f)
17191720
Py_INCREF(w);
17201721
PUSH(w);
17211722
}
1723+
Py_DECREF(v);
1724+
continue;
17221725
} else if (PyList_CheckExact(v) && PyList_GET_SIZE(v) == oparg) {
17231726
PyObject **items = ((PyListObject *)v)->ob_item;
17241727
while (oparg--) {
@@ -1746,6 +1749,7 @@ eval_frame(PyFrameObject *f)
17461749
err = PyObject_SetAttr(v, w, u); /* v.w = u */
17471750
Py_DECREF(v);
17481751
Py_DECREF(u);
1752+
if (err == 0) continue;
17491753
break;
17501754

17511755
case DELETE_ATTR:
@@ -1761,6 +1765,7 @@ eval_frame(PyFrameObject *f)
17611765
v = POP();
17621766
err = PyDict_SetItem(f->f_globals, w, v);
17631767
Py_DECREF(v);
1768+
if (err == 0) continue;
17641769
break;
17651770

17661771
case DELETE_GLOBAL:
@@ -1835,7 +1840,7 @@ eval_frame(PyFrameObject *f)
18351840
}
18361841
Py_INCREF(x);
18371842
PUSH(x);
1838-
break;
1843+
continue;
18391844

18401845
case DELETE_FAST:
18411846
x = GETLOCAL(oparg);
@@ -1854,6 +1859,7 @@ eval_frame(PyFrameObject *f)
18541859
x = freevars[oparg];
18551860
Py_INCREF(x);
18561861
PUSH(x);
1862+
if (x != NULL) continue;
18571863
break;
18581864

18591865
case LOAD_DEREF:

0 commit comments

Comments
 (0)