mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-29 10:41:05 -06:00
Merge pull request #787 from cmasone-attic/cleanup
Some compound{Set,Map} cleanup
This commit is contained in:
@@ -124,15 +124,13 @@ func (cm compoundMap) IterAllP(concurrency int, f mapIterAllCallback) {
|
||||
func (cm compoundMap) Filter(cb mapFilterCallback) Map {
|
||||
seq := newEmptySequenceChunker(makeMapLeafChunkFn(cm.t, cm.cs), newMapMetaSequenceChunkFn(cm.t, cm.cs), newMapLeafBoundaryChecker(), newOrderedMetaSequenceBoundaryChecker)
|
||||
|
||||
// Could conceivably use IterAllP() here.
|
||||
cm.IterAll(func(k, v Value) {
|
||||
if cb(k, v) {
|
||||
seq.Append(mapEntry{k, v})
|
||||
}
|
||||
})
|
||||
|
||||
m := seq.Done()
|
||||
return internalValueFromType(m, m.Type()).(Map)
|
||||
return internalValueFromType(seq.Done(), cm.Type()).(Map)
|
||||
}
|
||||
|
||||
func (cm compoundMap) Has(key Value) bool {
|
||||
|
||||
@@ -121,8 +121,7 @@ func (cs compoundSet) Filter(cb setFilterCallback) Set {
|
||||
}
|
||||
})
|
||||
|
||||
s := seq.Done()
|
||||
return internalValueFromType(s, s.Type()).(Set)
|
||||
return internalValueFromType(seq.Done(), cs.Type()).(Set)
|
||||
}
|
||||
|
||||
func (cs compoundSet) findLeaf(key Value) (*sequenceCursor, setLeaf, int) {
|
||||
|
||||
Reference in New Issue
Block a user