diff options
author | Karl Williamson <public@khwilliamson.com> | 2010-12-03 10:46:19 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-12-04 12:10:10 -0800 |
commit | acdf4139917b732417d6f16c26d2fd91e2abe3f5 (patch) | |
tree | 6326e15e405aa1c555be0bb76bae20123564ec56 /regcomp.c | |
parent | 79e7df4582a543b86199e7b30e50d9b258878b3e (diff) | |
download | perl-acdf4139917b732417d6f16c26d2fd91e2abe3f5.tar.gz |
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
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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 :-) */ |