From 685289b5657b776e8a3871de68a57785e6ccd797 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 3 Sep 2012 16:59:09 -0600 Subject: Use macro not swash for utf8 quotemeta The rules for matching whether an above-Latin1 code point are now saved in a macro generated from a trie by regen/regcharclass.pl, and these are now used by pp.c to test these cases. This allows removal of a wrapper subroutine, and also there is no need for dynamic loading at run-time into a swash. This macro is about as big as I'm comfortable compiling in, but it saves the building of a hash that can grow over time, and removes a subroutine and interpreter variables. Indeed, performance benchmarks show that it is about the same speed as a hash, but it does not require having to load the rules in from disk the first time it is used. --- utf8.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'utf8.c') diff --git a/utf8.c b/utf8.c index 49bc8de653..660002388f 100644 --- a/utf8.c +++ b/utf8.c @@ -2229,17 +2229,6 @@ Perl_is_utf8_X_extend(pTHX_ const U8 *p) return is_utf8_common(p, &PL_utf8_X_extend, "_X_Extend"); } -bool -Perl__is_utf8_quotemeta(pTHX_ const U8 *p) -{ - /* For exclusive use of pp_quotemeta() */ - - dVAR; - - PERL_ARGS_ASSERT__IS_UTF8_QUOTEMETA; - - return is_utf8_common(p, &PL_utf8_quotemeta, "_Perl_Quotemeta"); -} /* =for apidoc to_utf8_case -- cgit v1.2.1