mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-23 23:09:39 +03:00
[project @ 2005-07-16 16:15:37 by adrianl]
Faster utf8 next/prev functions svn path=/import/netsurf/; revision=1797
This commit is contained in:
parent
f4ecaaed31
commit
77f1158f6b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user