Merge b339e0f20d
into ba784d767a
This commit is contained in:
commit
2d59a045d8
5
gjson.go
5
gjson.go
|
@ -308,6 +308,7 @@ func (t Result) arrayOrMap(vc byte, valueize bool) (r arrayOrMapResult) {
|
||||||
var value Result
|
var value Result
|
||||||
var count int
|
var count int
|
||||||
var key Result
|
var key Result
|
||||||
|
var index = 0
|
||||||
if vc == 0 {
|
if vc == 0 {
|
||||||
for ; i < len(json); i++ {
|
for ; i < len(json); i++ {
|
||||||
if json[i] == '{' || json[i] == '[' {
|
if json[i] == '{' || json[i] == '[' {
|
||||||
|
@ -385,7 +386,9 @@ func (t Result) arrayOrMap(vc byte, valueize bool) (r arrayOrMapResult) {
|
||||||
if valueize {
|
if valueize {
|
||||||
r.oi[key.Str] = value.Value()
|
r.oi[key.Str] = value.Value()
|
||||||
} else {
|
} else {
|
||||||
|
value.Index = index
|
||||||
r.o[key.Str] = value
|
r.o[key.Str] = value
|
||||||
|
index++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
|
@ -393,7 +396,9 @@ func (t Result) arrayOrMap(vc byte, valueize bool) (r arrayOrMapResult) {
|
||||||
if valueize {
|
if valueize {
|
||||||
r.ai = append(r.ai, value.Value())
|
r.ai = append(r.ai, value.Value())
|
||||||
} else {
|
} else {
|
||||||
|
value.Index = index
|
||||||
r.a = append(r.a, value)
|
r.a = append(r.a, value)
|
||||||
|
index++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user