From 77f1158f6b01aab282f76074e49f20c9ffbcced7 Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Sat, 16 Jul 2005 16:15:37 +0000 Subject: [project @ 2005-07-16 16:15:37 by adrianl] Faster utf8 next/prev functions svn path=/import/netsurf/; revision=1797 --- utils/utf8.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'utils') diff --git a/utils/utf8.c b/utils/utf8.c index 6c06c76f5..56a1dab3a 100644 --- a/utils/utf8.c +++ b/utils/utf8.c @@ -172,8 +172,7 @@ size_t utf8_prev(const char *s, size_t o) { assert(s != NULL); - while (o != 0 && !(((s[--o] & 0x80) == 0x00) || - ((s[o] & 0xC0) == 0xC0))) + while (o != 0 && (s[--o] & 0xC0) == 0x80) /* do nothing */; return o; @@ -191,8 +190,7 @@ size_t utf8_next(const char *s, size_t l, size_t o) { assert(s != NULL); - while (o != l && !(((s[++o] & 0x80) == 0x00) || - ((s[o] & 0xC0) == 0xC0))) + while (o != l && (s[++o] & 0xC0) == 0x80) /* do nothing */; return o; -- cgit v1.2.3