From 62a59291d781403a6b0e279db4433a5f486e3a61 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 9 Aug 2014 18:07:48 -0600 Subject: [PATCH] regcomp.c: Avoid function call overhead We don't need to call a function to convert from UTF-8 when the value is invariant in and out of UTF-8. --- regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regcomp.c b/regcomp.c index 2a0350c..d3635cc 100644 --- a/regcomp.c +++ b/regcomp.c @@ -13491,7 +13491,7 @@ parseit: } else { /* Is a backslash; get the code point of the char after it */ - if (UTF) { + if (UTF && ! UTF8_IS_INVARIANT(RExC_parse)) { value = utf8n_to_uvchr((U8*)RExC_parse, RExC_end - RExC_parse, &numlen, UTF8_ALLOW_DEFAULT); -- 1.8.3.1