/[pcre]/code/trunk/pcre_compile.c
ViewVC logotype

Diff of /code/trunk/pcre_compile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 221 by ph10, Fri Aug 17 09:25:08 2007 UTC revision 223 by ph10, Mon Aug 20 11:07:53 2007 UTC
# Line 3176  for (;; ptr++) Line 3176  for (;; ptr++)
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
# Line 3190  for (;; ptr++) Line 3193  for (;; ptr++)
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

Legend:
Removed from v.221  
changed lines
  Added in v.223

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12