condense condition

This commit is contained in:
Benjamin Peterson 2010-04-25 21:54:00 +00:00
parent 80b09d49c1
commit a23831ff44
1 changed files with 1 additions and 4 deletions

View File

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