mirror of https://github.com/goccy/go-json.git
Optimize variables
This commit is contained in:
parent
2d022aa037
commit
1bb8b16200
|
@ -51,8 +51,7 @@ type acceptRange struct {
|
||||||
hi uint8 // highest value for second byte.
|
hi uint8 // highest value for second byte.
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
const (
|
||||||
sep = [2]byte{226, 128}
|
|
||||||
lineSep = byte(168) //'\u2028'
|
lineSep = byte(168) //'\u2028'
|
||||||
paragraphSep = byte(169) //'\u2029'
|
paragraphSep = byte(169) //'\u2029'
|
||||||
)
|
)
|
||||||
|
@ -109,8 +108,9 @@ func decodeRuneInString(s string) (decodeRuneState, int) {
|
||||||
return runeErrorState, 1
|
return runeErrorState, 1
|
||||||
}
|
}
|
||||||
if sz <= 3 {
|
if sz <= 3 {
|
||||||
if s[0] == sep[0] && s[1] == sep[1] {
|
// separator character prefixes: [2]byte{226, 128}
|
||||||
switch s[2] {
|
if s0 == 226 && s1 == 128 {
|
||||||
|
switch s2 {
|
||||||
case lineSep:
|
case lineSep:
|
||||||
return lineSepState, 3
|
return lineSepState, 3
|
||||||
case paragraphSep:
|
case paragraphSep:
|
||||||
|
|
Loading…
Reference in New Issue