From 8813104e5340ca4f1a6988b33cc551e009bae16b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 13 Oct 2011 01:12:01 +0200 Subject: 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) --- Include/unicodeobject.h | 11 +++++------ 1 file 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 -- cgit v0.12