diff options
author | Karl Williamson <khw@cpan.org> | 2016-01-18 23:14:10 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-01-19 15:09:00 -0700 |
commit | 973a28ed6e42449520d66bc69f677a120861ccb3 (patch) | |
tree | 6e4a8ec3625bada7aadac9a9adf2f08db3a11395 /proto.h | |
parent | 3571e9a754834338c4e5b8c1349920062570f2a0 (diff) | |
download | perl-973a28ed6e42449520d66bc69f677a120861ccb3.tar.gz |
Use lookup table for /\b{gcb}/ instead of switch stmt
This changes the handling of Grapheme Cluster Breaks to be entirely via
a lookup table generated by regen/mk_invlists.pl.
This is easier to maintain and follow, as the generation of the table
follows the text of Unicode's UAX29 precisely, and loops can be used to
set every class up instead of having to name each explicitly, so it will
be easier to add new rules. And the runtime switch statement is
replaced by a single line.
My gcc compiler optimized the previous version to an array lookup, but
this commit does it for not so clever compilers.
Diffstat (limited to 'proto.h')
-rw-r--r-- | proto.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5010,7 +5010,7 @@ STATIC bool S_isFOO_utf8_lc(pTHX_ const U8 classnum, const U8* character) #define PERL_ARGS_ASSERT_ISFOO_UTF8_LC \ assert(character) -STATIC bool S_isGCB(const GCB_enum before, const GCB_enum after) +PERL_STATIC_INLINE bool S_isGCB(const GCB_enum before, const GCB_enum after) __attribute__warn_unused_result__; STATIC bool S_isLB(pTHX_ LB_enum before, LB_enum after, const U8 * const strbeg, const U8 * const curpos, const U8 * const strend, const bool utf8_target) |