changeset: 76721:90b4c2d7c90d user: Victor Stinner date: Thu May 03 01:44:59 2012 +0200 files: Objects/unicodeobject.c description: Issue #14687: Optimize str%tuple for the "%(name)s" syntax Avoid an useless and expensive call to PyUnicode_READ(). diff -r 8635825b9734 -r 90b4c2d7c90d Objects/unicodeobject.c --- a/Objects/unicodeobject.c Wed May 02 20:51:59 2012 +0200 +++ b/Objects/unicodeobject.c Thu May 03 01:44:59 2012 +0200 @@ -13737,9 +13737,10 @@ keystart = fmtpos; /* Skip over balanced parentheses */ while (pcount> 0 && --fmtcnt>= 0) { - if (PyUnicode_READ(fmtkind, fmt, fmtpos) == ')') + c = PyUnicode_READ(fmtkind, fmt, fmtpos); + if (c == ')') --pcount; - else if (PyUnicode_READ(fmtkind, fmt, fmtpos) == '(') + else if (c == '(') ++pcount; fmtpos++; }

AltStyle によって変換されたページ (->オリジナル) /