summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-11-11 14:45:19 -0700
committerKarl Williamson <public@khwilliamson.com>2012-11-11 15:34:03 -0700
commit55025e0373118aae3b91192b1eb95b1aad0d6c9d (patch)
treeee9ca4f450268797d79b69dc42aac5ae4ec8b1bf /toke.c
parent3b721c4fa6c962f50c70cd5bc0c5cf5d3de95e0e (diff)
downloadperl-55025e0373118aae3b91192b1eb95b1aad0d6c9d.tar.gz
toke.c: Remove redundant checks
This code is redundant, as the whole string has been checked earlier for valid utf8ness, or we assume that the internal Perl handler, charnames, is correctly returning valid utf8.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/toke.c b/toke.c
index 53888caf48..4b2937a7ec 100644
--- a/toke.c
+++ b/toke.c
@@ -3518,17 +3518,6 @@ S_scan_const(pTHX_ char *start)
len,
&char_length,
UTF8_ALLOW_ANYUV);
-
- /* The call to is_utf8_string() above hopefully
- * guarantees that there won't be an error. But
- * it's easy here to make sure. The function just
- * above warns and returns 0 if invalid utf8, but
- * it can also return 0 if the input is validly a
- * NUL. Disambiguate */
- if (uv == 0 && NATIVE_TO_ASCII(*str) != '\0') {
- uv = UNICODE_REPLACEMENT;
- }
-
/* Convert first code point to hex, including the
* boiler plate before it. For all these, we
* convert to native format so that downstream code
@@ -3555,10 +3544,6 @@ S_scan_const(pTHX_ char *start)
str_end - str,
&char_length,
UTF8_ALLOW_ANYUV);
- if (uv == 0 && NATIVE_TO_ASCII(*str) != '\0') {
- uv = UNICODE_REPLACEMENT;
- }
-
output_length =
my_snprintf(hex_string, sizeof(hex_string),
".%X",