[Python-checkins] cpython (2.7): add braces and fix indentation

benjamin.peterson python-checkins at python.org
Mon Mar 31 01:23:32 CEST 2014


http://hg.python.org/cpython/rev/4cd80c35d954
changeset:   90055:4cd80c35d954
branch:      2.7
user:        Benjamin Peterson <benjamin at python.org>
date:        Sun Mar 30 19:23:24 2014 -0400
summary:
  add braces and fix indentation

files:
  Objects/stringobject.c |  35 +++++++++++++++--------------
  1 files changed, 18 insertions(+), 17 deletions(-)


diff --git a/Objects/stringobject.c b/Objects/stringobject.c
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -3125,25 +3125,26 @@
     q = PyString_AS_STRING(u); /* next output char */
     qe = PyString_AS_STRING(u) + PyString_GET_SIZE(u); /* end of output */
 
-    for (p = PyString_AS_STRING(self); p < e; p++)
-    if (*p == '\t') {
-        if (tabsize > 0) {
-            i = tabsize - (j % tabsize);
-            j += i;
-            while (i--) {
-                if (q >= qe)
-                    goto overflow2;
-                *q++ = ' ';
+    for (p = PyString_AS_STRING(self); p < e; p++) {
+        if (*p == '\t') {
+            if (tabsize > 0) {
+                i = tabsize - (j % tabsize);
+                j += i;
+                while (i--) {
+                    if (q >= qe)
+                        goto overflow2;
+                    *q++ = ' ';
+                }
             }
         }
-    }
-    else {
-        if (q >= qe)
-            goto overflow2;
-        *q++ = *p;
-        j++;
-        if (*p == '\n' || *p == '\r')
-            j = 0;
+        else {
+            if (q >= qe)
+                goto overflow2;
+            *q++ = *p;
+            j++;
+            if (*p == '\n' || *p == '\r')
+                j = 0;
+        }
     }
 
     return u;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list