Skip to content

Commit 438106b

Browse files
committed
Issue #14687: Cleanup PyUnicode_Format()
1 parent b5c3ea3 commit 438106b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Objects/unicodeobject.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13719,7 +13719,8 @@ PyUnicode_Format(PyObject *format, PyObject *args)
1371913719
PyObject *signobj = NULL, *fillobj = NULL;
1372013720

1372113721
fmtpos++;
13722-
if (PyUnicode_READ(fmtkind, fmt, fmtpos) == '(') {
13722+
c = PyUnicode_READ(fmtkind, fmt, fmtpos);
13723+
if (c == '(') {
1372313724
Py_ssize_t keystart;
1372413725
Py_ssize_t keylen;
1372513726
PyObject *key;
@@ -13765,7 +13766,8 @@ PyUnicode_Format(PyObject *format, PyObject *args)
1376513766
argidx = -2;
1376613767
}
1376713768
while (--fmtcnt >= 0) {
13768-
switch (c = PyUnicode_READ(fmtkind, fmt, fmtpos++)) {
13769+
c = PyUnicode_READ(fmtkind, fmt, fmtpos++);
13770+
switch (c) {
1376913771
case '-': flags |= F_LJUST; continue;
1377013772
case '+': flags |= F_SIGN; continue;
1377113773
case ' ': flags |= F_BLANK; continue;

0 commit comments

Comments
 (0)