mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-02 19:39:56 -05:00
Fix xml-importer & pitchmap/indexer
This commit is contained in:
@@ -33,23 +33,24 @@ func NomsValueFromDecodedJSON(cs chunks.ChunkStore, o interface{}) types.Value {
|
||||
case nil:
|
||||
return nil
|
||||
case []interface{}:
|
||||
out := types.NewList(cs)
|
||||
items := make([]types.Value, 0, len(o))
|
||||
for _, v := range o {
|
||||
nv := NomsValueFromDecodedJSON(cs, v)
|
||||
if nv != nil {
|
||||
out = out.Append(nv)
|
||||
items = append(items, nv)
|
||||
}
|
||||
}
|
||||
return out
|
||||
return types.NewList(cs, items...)
|
||||
case map[string]interface{}:
|
||||
out := NewMapOfStringToValue(cs)
|
||||
outDef := MapOfStringToValueDef{}
|
||||
|
||||
for k, v := range o {
|
||||
nv := NomsValueFromDecodedJSON(cs, v)
|
||||
if nv != nil {
|
||||
out = out.Set(k, nv)
|
||||
outDef[k] = nv
|
||||
}
|
||||
}
|
||||
return out
|
||||
return outDef.New(cs)
|
||||
default:
|
||||
d.Chk.Fail("Nomsification failed.", "I don't understand %+v, which is of type %s!\n", o, reflect.TypeOf(o).String())
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ func (cl compoundList) cursorAt(idx uint64) (*sequenceCursor, listLeaf, uint64)
|
||||
return idx < offset, offset
|
||||
}, uint64(0))
|
||||
|
||||
if current := cursor.current().(metaTuple); current.ref != leaf.Ref() {
|
||||
if current := cursor.current().(metaTuple); current.ref != valueFromType(cl.cs, leaf, leaf.Type()).Ref() {
|
||||
leaf = readMetaTupleValue(cursor.current(), cl.cs)
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ func (cm compoundMap) findLeaf(key Value) (*sequenceCursor, mapLeaf) {
|
||||
cursor.seekBinary(seekFn)
|
||||
|
||||
current := cursor.current().(metaTuple)
|
||||
if current.ref != leaf.Ref() {
|
||||
if current.ref != valueFromType(cm.cs, leaf, leaf.Type()).Ref() {
|
||||
leaf = readMetaTupleValue(cursor.current(), cm.cs)
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ func (cs compoundSet) findLeaf(key Value) (*sequenceCursor, setLeaf) {
|
||||
cursor.seekBinary(seekFn)
|
||||
|
||||
current := cursor.current().(metaTuple)
|
||||
if current.ref != leaf.Ref() {
|
||||
if current.ref != valueFromType(cs.cs, leaf, leaf.Type()).Ref() {
|
||||
leaf = readMetaTupleValue(cursor.current(), cs.cs)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user