(original) (raw)
changeset: 76706:a966f9311ebb user: Victor Stinner victor.stinner@gmail.com date: Wed May 02 00:41:57 2012 +0200 files: Objects/unicodeobject.c description: Issue #14687: Cleanup PyUnicode_Format() diff -r 4b98ce6ef95e -r a966f9311ebb Objects/unicodeobject.c --- a/Objects/unicodeobject.c Wed May 02 00:29:36 2012 +0200 +++ b/Objects/unicodeobject.c Wed May 02 00:41:57 2012 +0200 @@ -13719,7 +13719,8 @@ PyObject *signobj = NULL, *fillobj = NULL; fmtpos++; - if (PyUnicode_READ(fmtkind, fmt, fmtpos) == '(') { + c = PyUnicode_READ(fmtkind, fmt, fmtpos); + if (c == '(') { Py_ssize_t keystart; Py_ssize_t keylen; PyObject *key; @@ -13765,7 +13766,8 @@ argidx = -2; } while (--fmtcnt >= 0) { - switch (c = PyUnicode_READ(fmtkind, fmt, fmtpos++)) { + c = PyUnicode_READ(fmtkind, fmt, fmtpos++); + switch (c) { case '-': flags |= F_LJUST; continue; case '+': flags |= F_SIGN; continue; case ' ': flags |= F_BLANK; continue; /victor.stinner@gmail.com