MCPcopy Index your code
hub / github.com/cloudfoundry/cli / Reduce

Function Reduce

util/generic/merge_reduce.go:23–30  ·  view source on GitHub ↗
(collections []Map, resultVal Map, cb Reducer)

Source from the content-addressed store, hash-verified

21}
22
23func Reduce(collections []Map, resultVal Map, cb Reducer) Map {
24 for _, collection := range collections {
25 for _, key := range collection.Keys() {
26 resultVal = cb(key, collection.Get(key), resultVal)
27 }
28 }
29 return resultVal
30}
31
32func mergeReducer(key, val interface{}, reduced Map) Map {
33 switch {

Callers 2

DeepMergeFunction · 0.85
mergeReducerFunction · 0.85

Calls 2

KeysMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected