diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-12 23:12:01 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-12 23:12:01 (GMT) |
commit | 8813104e5340ca4f1a6988b33cc551e009bae16b (patch) | |
tree | 2fe0c3ca4aefcd30dcb8c700934e3e0023dec76e /Include/unicodeobject.h | |
parent | 9e7a1bcfd6737de148dd99c953e1d079ad3f239a (diff) | |
download | cpython-8813104e5340ca4f1a6988b33cc551e009bae16b.zip cpython-8813104e5340ca4f1a6988b33cc551e009bae16b.tar.gz cpython-8813104e5340ca4f1a6988b33cc551e009bae16b.tar.bz2 |
Simplify PyUnicode_MAX_CHAR_VALUE
Use PyUnicode_IS_ASCII instead of PyUnicode_IS_COMPACT_ASCII, so the following
test can be removed:
PyUnicode_DATA(op) == (((PyCompactUnicodeObject *)(op))->utf8)
Diffstat (limited to 'Include/unicodeobject.h')
-rw-r--r-- | Include/unicodeobject.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 8fbad09..524ce8a 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -548,14 +548,13 @@ enum PyUnicode_Kind { than iterating over the string. */ #define PyUnicode_MAX_CHAR_VALUE(op) \ (assert(PyUnicode_IS_READY(op)), \ - (PyUnicode_IS_COMPACT_ASCII(op) ? 0x7f: \ + (PyUnicode_IS_ASCII(op) ? \ + (0x7f) : \ (PyUnicode_KIND(op) == PyUnicode_1BYTE_KIND ? \ - (PyUnicode_DATA(op) == (((PyCompactUnicodeObject *)(op))->utf8) ? \ - (0x7fU) : (0xffU) \ - ) : \ + (0xffU) : \ (PyUnicode_KIND(op) == PyUnicode_2BYTE_KIND ? \ - (0xffffU) : (0x10ffffU) \ - )))) + (0xffffU) : \ + (0x10ffffU))))) #endif |