diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-09-02 13:09:48 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-09-13 21:14:01 -0600 |
commit | e021c6e6e7e20352e84d2f2a578c324b8d0b490c (patch) | |
tree | 72bf4260fe4c9e8798ad2f7efa35d76601a01dd6 /utf8.h | |
parent | bb88be5fd5ba24c1df8fcf9754c8428ea037c246 (diff) | |
download | perl-e021c6e6e7e20352e84d2f2a578c324b8d0b490c.tar.gz |
utf8.h: Save a branch in a macro
By adding a mask, we can save a branch. The two expressions match the
exact same code points.
Diffstat (limited to 'utf8.h')
-rw-r--r-- | utf8.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -164,7 +164,7 @@ Perl's extended UTF-8 means we can have start bytes up to FF. #define UNI_IS_INVARIANT(c) (((UV)c) < 0x80) #define UTF8_IS_START(c) (((U8)c) >= 0xc2) -#define UTF8_IS_CONTINUATION(c) (((U8)c) >= 0x80 && (((U8)c) <= 0xbf)) +#define UTF8_IS_CONTINUATION(c) ((((U8)c) & 0xC0) == 0x80) #define UTF8_IS_CONTINUED(c) (((U8)c) & 0x80) /* Masking with 0xfe allows low bit to be 0 or 1; thus this matches 0xc[23] */ |