| 3176 |
} |
} |
| 3177 |
|
|
| 3178 |
/* If class_charcount is 1, we saw precisely one character whose value is |
/* If class_charcount is 1, we saw precisely one character whose value is |
| 3179 |
less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we |
less than 256. As long as there were no characters >= 128 and there was no |
| 3180 |
can optimize the negative case only if there were no characters >= 128 |
use of \p or \P, in other words, no use of any XCLASS features, we can |
| 3181 |
because OP_NOT and the related opcodes like OP_NOTSTAR operate on |
optimize. |
| 3182 |
single-bytes only. This is an historical hangover. Maybe one day we can |
|
| 3183 |
tidy these opcodes to handle multi-byte characters. |
In UTF-8 mode, we can optimize the negative case only if there were no |
| 3184 |
|
characters >= 128 because OP_NOT and the related opcodes like OP_NOTSTAR |
| 3185 |
|
operate on single-bytes only. This is an historical hangover. Maybe one day |
| 3186 |
|
we can tidy these opcodes to handle multi-byte characters. |
| 3187 |
|
|
| 3188 |
The optimization throws away the bit map. We turn the item into a |
The optimization throws away the bit map. We turn the item into a |
| 3189 |
1-character OP_CHAR[NC] if it's positive, or OP_NOT if it's negative. Note |
1-character OP_CHAR[NC] if it's positive, or OP_NOT if it's negative. Note |
| 3193 |
reqbyte, save the previous value for reinstating. */ |
reqbyte, save the previous value for reinstating. */ |
| 3194 |
|
|
| 3195 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 3196 |
if (class_charcount == 1 && |
if (class_charcount == 1 && !class_utf8 && |
| 3197 |
(!utf8 || |
(!utf8 || !negate_class || class_lastchar < 128)) |
|
(!class_utf8 && (!negate_class || class_lastchar < 128)))) |
|
|
|
|
| 3198 |
#else |
#else |
| 3199 |
if (class_charcount == 1) |
if (class_charcount == 1) |
| 3200 |
#endif |
#endif |