Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 73186:60798098e863
Cast directly to unsigned char, instead of using Py_CHARMASK
We don't need "& 0xff" on an unsigned char.
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Sun, 23 Oct 2011 20:06:00 +0200 |
| parents | f61db5671cc8 |
| children | d8c36928d35b |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Sun Oct 23 20:04:37 2011 +0200 +++ b/Objects/unicodeobject.c Sun Oct 23 20:06:00 2011 +0200 @@ -1652,8 +1652,8 @@ /* Single characters are shared when using this constructor. Restrict to ASCII, since the input must be UTF-8. */ - if (size == 1 && Py_CHARMASK(*u) < 128) - return get_latin1_char(Py_CHARMASK(*u)); + if (size == 1 && (unsigned char)*u < 128) + return get_latin1_char((unsigned char)*u); return PyUnicode_DecodeUTF8(u, size, NULL); }
