mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Fixed compare function to do first char comparison in unsigned mode,
for consistency with the way other characters are compared.
This commit is contained in:
parent
149574767c
commit
fde7a75b78
1 changed files with 1 additions and 1 deletions
|
@ -394,7 +394,7 @@ string_compare(a, b)
|
|||
int min_len = (len_a < len_b) ? len_a : len_b;
|
||||
int cmp;
|
||||
if (min_len > 0) {
|
||||
cmp = *a->ob_sval - *b->ob_sval;
|
||||
cmp = Py_CHARMASK(*a->ob_sval) - Py_CHARMASK(*b->ob_sval);
|
||||
if (cmp == 0)
|
||||
cmp = memcmp(a->ob_sval, b->ob_sval, min_len);
|
||||
if (cmp != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue