diff options
author | Volker Lendecke <vl@samba.org> | 2016-10-25 12:28:12 +0200 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2017-01-22 18:30:11 +0100 |
commit | 07d9a909ba6853fb0b96f6d86e4cf0d5d1b35b28 (patch) | |
tree | a7dfdcdb2384119f3bfd295d4e2ee96782e0364f | |
parent | 66cba9939b76fbfad91a6fe7156feb898b51b2ad (diff) | |
download | samba-07d9a909ba6853fb0b96f6d86e4cf0d5d1b35b28.tar.gz |
lib/util/charset: Optimize next_codepoint for the ascii case
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r-- | lib/util/charset/codepoints.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/util/charset/codepoints.c b/lib/util/charset/codepoints.c index 3d444a6df31..2c9a9c4b136 100644 --- a/lib/util/charset/codepoints.c +++ b/lib/util/charset/codepoints.c @@ -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); } |