[Python-checkins] cpython (2.7): fix indentation and add curlies (closes #27093)

benjamin.peterson python-checkins at python.org
Tue May 24 01:48:16 EDT 2016


https://hg.python.org/cpython/rev/f0438e1a4761
changeset:   101484:f0438e1a4761
branch:      2.7
parent:      101478:a873265366ba
user:        Benjamin Peterson <benjamin at python.org>
date:        Mon May 23 22:47:50 2016 -0700
summary:
  fix indentation and add curlies (closes #27093)

files:
  Modules/cjkcodecs/cjkcodecs.h |  26 +++++++++++++---------
  1 files changed, 15 insertions(+), 11 deletions(-)


diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -325,22 +325,26 @@
     min = 0;
     max = haystacksize;
 
-    for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1)
+    for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) {
         if (value < haystack[pos].uniseq) {
-            if (max == pos) break;
-            else max = pos;
+            if (max != pos) {
+                max = pos;
+                continue;
+            }
         }
         else if (value > haystack[pos].uniseq) {
-            if (min == pos) break;
-            else min = pos;
+            if (min != pos) {
+                min = pos;
+                continue;
+            }
         }
-        else
-            break;
+        break;
+    }
 
-        if (value == haystack[pos].uniseq)
-            return haystack[pos].code;
-        else
-            return DBCINV;
+    if (value == haystack[pos].uniseq) {
+        return haystack[pos].code;
+    }
+    return DBCINV;
 }
 #endif
 

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


More information about the Python-checkins mailing list