]> granicus.if.org Git - python/commitdiff
condense condition
authorBenjamin Peterson <benjamin@python.org>
Sun, 25 Apr 2010 21:54:00 +0000 (21:54 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 25 Apr 2010 21:54:00 +0000 (21:54 +0000)
Objects/unicodeobject.c

index ae401a6b62777d07a6a687ca03e35ca4176007d7..3851008a8815f9527fc82f9797e885750adf0c17 100644 (file)
@@ -6784,10 +6784,7 @@ PyUnicode_CompareWithASCIIString(PyObject* uni, const char* str)
             return ((int)id[i] < (int)str[i]) ? -1 : 1;
     /* This check keeps Python strings that end in '\0' from comparing equal
      to C strings identical up to that point. */
-    if (PyUnicode_GET_SIZE(uni) != i)
-        /* We'll say the Python string is longer. */
-        return 1;
-    if (id[i])
+    if (PyUnicode_GET_SIZE(uni) != i || id[i])
         return 1; /* uni is longer */
     if (str[i])
         return -1; /* str is longer */