summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2014-08-09 18:07:48 -0600
committerKarl Williamson <khw@cpan.org>2014-08-21 14:49:46 -0600
commit62a59291d781403a6b0e279db4433a5f486e3a61 (patch)
treef45fa4acd8fdfc59bb67329a7300d471f789a9c6 /regcomp.c
parent91f68955b1c2ec85044e23de0b0627a87e20e914 (diff)
downloadperl-62a59291d781403a6b0e279db4433a5f486e3a61.tar.gz
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.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 2a0350ca07..d3635cc8d6 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);