mirror of https://github.com/goccy/go-json.git
Refactor skipValue
This commit is contained in:
parent
304c9ab4e2
commit
4f979d764e
|
@ -48,18 +48,20 @@ func (d *structDecoder) skipValue(buf []byte, cursor int) (int, error) {
|
|||
}
|
||||
case '"':
|
||||
cursor++
|
||||
|
||||
for ; cursor < buflen; cursor++ {
|
||||
switch buf[cursor] {
|
||||
case '\\':
|
||||
cursor++
|
||||
case '"':
|
||||
if buf[cursor] != '"' {
|
||||
continue
|
||||
}
|
||||
if buf[cursor-1] == '\\' {
|
||||
continue
|
||||
}
|
||||
if bracketCount == 0 && braceCount == 0 {
|
||||
return cursor + 1, nil
|
||||
}
|
||||
goto QUOTE_END
|
||||
break
|
||||
}
|
||||
}
|
||||
QUOTE_END:
|
||||
|
||||
}
|
||||
cursor++
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue