Skip to content

Commit e496fad

Browse files
committed
Simplify code.
1 parent 6d09d17 commit e496fad

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

json_parser.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,15 @@ static int __json_string_length(const char *cursor)
5656
{
5757
int len = 0;
5858

59-
while (1)
59+
while (*cursor != '\"')
6060
{
61-
if (*cursor == '\"')
62-
break;
63-
64-
if (*(const unsigned char *)cursor < ' ')
61+
if ((unsigned char)*cursor < ' ')
6562
return -2;
6663

6764
cursor++;
6865
if (cursor[-1] == '\\')
6966
{
70-
if (!*cursor)
67+
if (*cursor == '\0')
7168
return -2;
7269

7370
cursor++;

0 commit comments

Comments
 (0)