[Python-checkins] cpython: Issue #14687: Cleanup PyUnicode_Format()
victor.stinner
python-checkins at python.org
Wed May 2 01:19:10 CEST 2012
http://hg.python.org/cpython/rev/a966f9311ebb
changeset: 76706:a966f9311ebb
user: Victor Stinner <victor.stinner at gmail.com>
date: Wed May 02 00:41:57 2012 +0200
summary:
Issue #14687: Cleanup PyUnicode_Format()
files:
Objects/unicodeobject.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -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;
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list