lang: core: iter: Make map coding more consistent with filter
Keeping the code looking similar makes it easy to patch bugs that occur in both.
This commit is contained in:
@@ -285,6 +285,8 @@ func (obj *MapFunc) replaceSubGraph(subgraphInput interfaces.Func) error {
|
|||||||
// XXX: hack add this edge that I thought would happen in call.go
|
// XXX: hack add this edge that I thought would happen in call.go
|
||||||
obj.init.Txn.AddEdge(obj, funcSubgraphOutput, &interfaces.FuncEdge{Args: []string{structs.OutputFuncDummyArgName}}) // "dummy"
|
obj.init.Txn.AddEdge(obj, funcSubgraphOutput, &interfaces.FuncEdge{Args: []string{structs.OutputFuncDummyArgName}}) // "dummy"
|
||||||
|
|
||||||
|
argNameInputList := "inputList"
|
||||||
|
|
||||||
m := make(map[string]*types.Type)
|
m := make(map[string]*types.Type)
|
||||||
ord := []string{}
|
ord := []string{}
|
||||||
for i := 0; i < obj.lastInputListLength; i++ {
|
for i := 0; i < obj.lastInputListLength; i++ {
|
||||||
@@ -337,7 +339,7 @@ func (obj *MapFunc) replaceSubGraph(subgraphInput interfaces.Func) error {
|
|||||||
// Extract the correct list element.
|
// Extract the correct list element.
|
||||||
return list.List()[i], nil
|
return list.List()[i], nil
|
||||||
},
|
},
|
||||||
T: types.NewType(fmt.Sprintf("func(inputList %s) %s", obj.inputListType, obj.Type)),
|
T: types.NewType(fmt.Sprintf("func(%s %s) %s", argNameInputList, obj.inputListType, obj.Type)),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
obj.init.Txn.AddVertex(inputElemFunc)
|
obj.init.Txn.AddVertex(inputElemFunc)
|
||||||
@@ -348,7 +350,7 @@ func (obj *MapFunc) replaceSubGraph(subgraphInput interfaces.Func) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
obj.init.Txn.AddEdge(subgraphInput, inputElemFunc, &interfaces.FuncEdge{
|
obj.init.Txn.AddEdge(subgraphInput, inputElemFunc, &interfaces.FuncEdge{
|
||||||
Args: []string{"inputList"},
|
Args: []string{argNameInputList},
|
||||||
})
|
})
|
||||||
obj.init.Txn.AddEdge(outputElemFunc, outputListFunc, &interfaces.FuncEdge{
|
obj.init.Txn.AddEdge(outputElemFunc, outputListFunc, &interfaces.FuncEdge{
|
||||||
Args: []string{fmt.Sprintf("outputElem%d", i)},
|
Args: []string{fmt.Sprintf("outputElem%d", i)},
|
||||||
|
|||||||
Reference in New Issue
Block a user