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)
This commit is contained in:
Victor Stinner 2011-10-13 01:12:01 +02:00
parent 9e7a1bcfd6
commit 8813104e53
1 changed files with 5 additions and 6 deletions

View File

@ -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