This refactoring makes it clear that within a (?[]), we don't try to
optimize the [] part. This is for clarity for the future only, as
currently the only changed behavior is if this is being compiled with /l
rules, and (?[]) generates a syntax error under /l.
/* If the character class contains only a single element, it may be
* optimizable into another node type which is smaller and runs faster.
* Check if this is the case for this class */
- if ((element_count == 1 && ! ret_invlist)
- || UNLIKELY(posixl_matches_all))
+ if (! ret_invlist /* Can't optimize if returning the constructed
+ inversion list */
+ && (UNLIKELY(posixl_matches_all) || element_count == 1))
{
U8 op = END;
U8 arg = 0;