mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
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:
parent
9e7a1bcfd6
commit
8813104e53
1 changed files with 5 additions and 6 deletions
|
@ -548,14 +548,13 @@ enum PyUnicode_Kind {
|
||||||
than iterating over the string. */
|
than iterating over the string. */
|
||||||
#define PyUnicode_MAX_CHAR_VALUE(op) \
|
#define PyUnicode_MAX_CHAR_VALUE(op) \
|
||||||
(assert(PyUnicode_IS_READY(op)), \
|
(assert(PyUnicode_IS_READY(op)), \
|
||||||
(PyUnicode_IS_COMPACT_ASCII(op) ? 0x7f: \
|
(PyUnicode_IS_ASCII(op) ? \
|
||||||
|
(0x7f) : \
|
||||||
(PyUnicode_KIND(op) == PyUnicode_1BYTE_KIND ? \
|
(PyUnicode_KIND(op) == PyUnicode_1BYTE_KIND ? \
|
||||||
(PyUnicode_DATA(op) == (((PyCompactUnicodeObject *)(op))->utf8) ? \
|
(0xffU) : \
|
||||||
(0x7fU) : (0xffU) \
|
|
||||||
) : \
|
|
||||||
(PyUnicode_KIND(op) == PyUnicode_2BYTE_KIND ? \
|
(PyUnicode_KIND(op) == PyUnicode_2BYTE_KIND ? \
|
||||||
(0xffffU) : (0x10ffffU) \
|
(0xffffU) : \
|
||||||
))))
|
(0x10ffffU)))))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue