This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: Don't do redundant test
authorKarl Williamson <public@khwilliamson.com>
Wed, 1 Jan 2014 04:41:09 +0000 (21:41 -0700)
committerKarl Williamson <public@khwilliamson.com>
Wed, 1 Jan 2014 20:49:23 +0000 (13:49 -0700)
The test here for WARN_UTF8 is redundant, as only if one of the other
three warning categories is enabled will anything actually be output.

utf8.c

diff --git a/utf8.c b/utf8.c
index 3b4aa8f..7eb4374 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -107,7 +107,7 @@ Perl_uvoffuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags)
 
     /* The first problematic code point is the first surrogate */
     if (uv >= UNICODE_SURROGATE_FIRST
-        && ckWARN4_d(WARN_UTF8, WARN_SURROGATE, WARN_NON_UNICODE, WARN_NONCHAR))
+        && ckWARN3_d(WARN_SURROGATE, WARN_NON_UNICODE, WARN_NONCHAR))
     {
        if (UNICODE_IS_SURROGATE(uv)) {
            if (flags & UNICODE_WARN_SURROGATE) {