The flag ANYOF_UNICODE_ALL is for performance. It is set when the
inversion list for the ANYOF node includes every code point above
Latin1, and avoids runtime searching through the list. We don't need
both, as the flag being set short-circuits even looking at the other
list. By removing the code points from the list, we perhaps will get
rid of the list entirely, thus saving some operations, or will shorten
it so that later binary searches run faster.
invlist_iterfinish(cp_list);
/* Done with loop; remove any code points that are in the bitmap from
- * <cp_list> */
+ * <cp_list>; similarly for code points above latin1 if we have a flag
+ * to match all of them anyways */
if (change_invlist) {
_invlist_subtract(cp_list, PL_Latin1, &cp_list);
}
+ if (ANYOF_FLAGS(ret) & ANYOF_UNICODE_ALL) {
+ _invlist_intersection(cp_list, PL_Latin1, &cp_list);
+ }
/* If have completely emptied it, remove it completely */
if (_invlist_len(cp_list) == 0) {