lib/util/charset: Optimize next_codepoint for the ascii case
authorVolker Lendecke <vl@samba.org>
Tue, 25 Oct 2016 10:28:12 +0000 (12:28 +0200)
committerRalph Boehme <slow@samba.org>
Sun, 22 Jan 2017 17:30:11 +0000 (18:30 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/util/charset/codepoints.c

index 3d444a6df31902c8dafc762b9b8bfec83ec40da7..2c9a9c4b1365916a6c0990cd285f5ce74cd3fc58 100644 (file)
@@ -16817,6 +16817,10 @@ _PUBLIC_ codepoint_t next_codepoint_ext(const char *str, size_t len,
 
 _PUBLIC_ codepoint_t next_codepoint(const char *str, size_t *size)
 {
+       if ((str[0] & 0x80) == 0) {
+               *size = 1;
+               return str[0];
+       }
        return next_codepoint_handle(get_iconv_handle(), str, size);
 }