From 6dcb56c449da3fdda9b237a170128966d4bf6ba8 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Fri, 29 Dec 2017 14:12:26 +0100 Subject: [PATCH] UTF-8: Probably small optimization, but not sure. --- ucw/unicode.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ucw/unicode.h b/ucw/unicode.h index d84f5038..c47d436a 100644 --- a/ucw/unicode.h +++ b/ucw/unicode.h @@ -299,11 +299,12 @@ static inline uint unicode_sanitize_char_internal(uint u, uint limit, uint allow goto bad; // Outside Unicode range } else if (u < 0xa0) - goto bad; // 0x80..0x9f Latin-1 control chars + { // 0x80..0x9f Latin-1 control chars +bad: + u = UNI_REPLACEMENT; + } } return u; -bad: - return UNI_REPLACEMENT; } /** -- 2.39.2