Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

play with tweaks to yajl_string_scan: use ptrs to remove an inc in ti…

…ght loop.
  • Loading branch information...
commit 53ff7dce43138c51df155995a6e80d67c8549758 1 parent bb39689
@lloyd authored
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/yajl_lex.c
View
11 src/yajl_lex.c
@@ -255,13 +255,10 @@ static size_t
yajl_string_scan(const unsigned char * buf, size_t len, int utf8check)
{
unsigned char mask = IJC|NFP|(utf8check ? NUC : 0);
- size_t skip = 0;
- while (skip < len && !(charLookupTable[*buf] & mask))
- {
- skip++;
- buf++;
- }
- return skip;
+ const unsigned char * orig = buf;
+ const unsigned char * end = buf + len;
+ while (buf < end && !(charLookupTable[*buf] & mask)) buf++;
+ return buf - orig;
}
static yajl_tok
Please sign in to comment.
Something went wrong with that request. Please try again.