summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-10-25 12:28:12 +0200
committerRalph Boehme <slow@samba.org>2017-01-22 18:30:11 +0100
commit07d9a909ba6853fb0b96f6d86e4cf0d5d1b35b28 (patch)
treea7dfdcdb2384119f3bfd295d4e2ee96782e0364f /lib
parent66cba9939b76fbfad91a6fe7156feb898b51b2ad (diff)
downloadsamba-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>
Diffstat (limited to 'lib')
-rw-r--r--lib/util/charset/codepoints.c4
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);
}