From acdf4139917b732417d6f16c26d2fd91e2abe3f5 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 3 Dec 2010 10:46:19 -0700 Subject: regcomp.c: small efficiency, portability fix The code had hard-coded into it the ascii platform values for possible start bytes. There are macros that do that portably with no branches --- regcomp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/regcomp.c b/regcomp.c index b5cc357dbe..17a46a8c73 100644 --- a/regcomp.c +++ b/regcomp.c @@ -1484,12 +1484,9 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs if ( !UTF ) { /* store first byte of utf8 representation of - codepoints in the 127 < uvc < 256 range */ - if (127 < uvc && uvc < 192) { - TRIE_BITMAP_SET(trie,194); - } else if (191 < uvc ) { - TRIE_BITMAP_SET(trie,195); - /* && uvc < 256 -- we know uvc is < 256 already */ + variant codepoints */ + if (! UNI_IS_INVARIANT(uvc)) { + TRIE_BITMAP_SET(trie, UTF8_TWO_BYTE_HI(uvc)); } } set_bit = 0; /* We've done our bit :-) */ -- cgit v1.2.1