diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-05-03 20:59:48 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-05-03 20:59:48 (GMT) |
commit | 777e4ff5039d1ac5aba9bb16b6edcb00d4d7c151 (patch) | |
tree | 61cf06f9a617acf6357dd1dbe74ba8970bbf9e36 /Objects | |
parent | 85e269b37d6b6599fd143c72395f5e6d58f15088 (diff) | |
download | cpython-777e4ff5039d1ac5aba9bb16b6edcb00d4d7c151.zip cpython-777e4ff5039d1ac5aba9bb16b6edcb00d4d7c151.tar.gz cpython-777e4ff5039d1ac5aba9bb16b6edcb00d4d7c151.tar.bz2 |
Eliminate some locale-dependent calls to isspace and tolower.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/complexobject.c | 8 | ||||
-rw-r--r-- | Objects/floatobject.c | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 2ae8056..f0f2541 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -950,13 +950,13 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) /* position on first nonblank */ start = s; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; if (*s == '(') { /* Skip over possible bracket from repr(). */ got_bracket = 1; s++; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; } @@ -1038,7 +1038,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) } /* trailing whitespace and closing bracket */ - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; if (got_bracket) { /* if there was an opening parenthesis, then the corresponding @@ -1046,7 +1046,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) if (*s != ')') goto parse_error; s++; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; } diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 58f27e6..9a0dbb3 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -214,7 +214,7 @@ PyFloat_FromString(PyObject *v, char **pend) } 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 @@ PyFloat_FromString(PyObject *v, char **pend) } /* 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 @@ float_fromhex(PyObject *cls, PyObject *arg) ********************/ /* leading whitespace and optional sign */ - while (isspace(*s)) + while (Py_ISSPACE(*s)) s++; if (*s == '-') { s++; @@ -1244,7 +1244,7 @@ float_fromhex(PyObject *cls, PyObject *arg) 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 @@ float_fromhex(PyObject *cls, PyObject *arg) 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 @@ float_fromhex(PyObject *cls, PyObject *arg) 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; |