Mercurial > cpython-lru_cache-weakref
diff Objects/floatobject.c @ 53712:1f00bc1d115a legacy-trunk
Eliminate some locale-dependent calls to isspace and tolower.
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Sun, 03 May 2009 20:59:48 +0000 |
| parents | 4762394fc26c |
| children | 1d8f24d40c2c |
line wrap: on
line diff
--- a/Objects/floatobject.c Sun May 03 20:39:06 2009 +0000 +++ b/Objects/floatobject.c Sun May 03 20:59:48 2009 +0000 @@ -214,7 +214,7 @@ } last = s + len; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; /* We don't care about overflow or underflow. If the platform * supports them, infinities and signed zeroes (on underflow) are @@ -235,7 +235,7 @@ } /* Since end != s, the platform made *some* kind of sense out of the input. Trust it. */ - while (*end && isspace(Py_CHARMASK(*end))) + while (Py_ISSPACE(*end)) end++; if (end != last) { if (*end == '\0') @@ -1220,7 +1220,7 @@ ********************/ /* leading whitespace and optional sign */ - while (isspace(*s)) + while (Py_ISSPACE(*s)) s++; if (*s == '-') { s++; @@ -1244,7 +1244,7 @@ s_store = s; if (*s == '0') { s++; - if (tolower(*s) == (int)'x') + if (*s == 'x' || *s == 'X') s++; else s = s_store; @@ -1274,7 +1274,7 @@ goto insane_length_error; /* [p <exponent>] */ - if (tolower(*s) == (int)'p') { + if (*s == 'p' || *s == 'P') { s++; exp_start = s; if (*s == '-' || *s == '+') @@ -1290,7 +1290,7 @@ exp = 0; /* optional trailing whitespace leading to the end of the string */ - while (isspace(*s)) + while (Py_ISSPACE(*s)) s++; if (s != s_end) goto parse_error;
