summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-02-13 22:10:19 -0700
committerKarl Williamson <public@khwilliamson.com>2013-08-29 09:55:50 -0600
commit9ff651ce1ced9c225b5fa63d6825396dc3f96fe7 (patch)
tree347bb294947d778325cde744ae0c13bc36739c20 /inline.h
parent67af0a71470eeb7adf1b58773a5db09f3cc5cb70 (diff)
downloadperl-9ff651ce1ced9c225b5fa63d6825396dc3f96fe7.tar.gz
Remove unnecessary temp variable in converting to UTF-8
These areas of code included a temporary that is unnecessary.
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/inline.h b/inline.h
index 63a5e064d1..b95663fc07 100644
--- a/inline.h
+++ b/inline.h
@@ -209,15 +209,13 @@ S_append_utf8_from_native_byte(const U8 byte, U8** dest)
/* Takes an input 'byte' (Latin1 or EBCDIC) and appends it to the UTF-8
* encoded string at '*dest', updating '*dest' to include it */
- const U8 uv = NATIVE_TO_LATIN1(byte);
-
PERL_ARGS_ASSERT_APPEND_UTF8_FROM_NATIVE_BYTE;
- if (UNI_IS_INVARIANT(uv))
- *(*dest)++ = UNI_TO_NATIVE(uv);
+ if (NATIVE_IS_INVARIANT(byte))
+ *(*dest)++ = byte;
else {
- *(*dest)++ = UTF8_EIGHT_BIT_HI(uv);
- *(*dest)++ = UTF8_EIGHT_BIT_LO(uv);
+ *(*dest)++ = UTF8_EIGHT_BIT_HI(byte);
+ *(*dest)++ = UTF8_EIGHT_BIT_LO(byte);
}
}