summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Lees <adrian@aemulor.com>2005-07-16 16:15:37 +0000
committerAdrian Lees <adrian@aemulor.com>2005-07-16 16:15:37 +0000
commit77f1158f6b01aab282f76074e49f20c9ffbcced7 (patch)
treeb717d90d4f2bb14a362f248fd01f334bed3e3ba5
parentf4ecaaed31db0aa5d71c05dd3f04dc2833ad29fe (diff)
downloadnetsurf-77f1158f6b01aab282f76074e49f20c9ffbcced7.tar.gz
netsurf-77f1158f6b01aab282f76074e49f20c9ffbcced7.tar.bz2
[project @ 2005-07-16 16:15:37 by adrianl]
Faster utf8 next/prev functions svn path=/import/netsurf/; revision=1797
-rw-r--r--utils/utf8.c6
1 files changed, 2 insertions, 4 deletions
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;