优化代码

This commit is contained in:
boyce
2025-09-23 15:06:57 +08:00
parent 77e2986ffb
commit 2a12d40f7a
3 changed files with 42 additions and 4 deletions

View File

@@ -90,12 +90,13 @@ func (en *execNode) Do(gr *Graph, outPortArgs ...any) error {
OutputPorts: outPorts,
}
startOutIdx := en.execNode.GetOutPortParamStartIndex()
for i := 0; i < len(outPortArgs); i++ {
if i >= len(outPorts) {
return fmt.Errorf("args %d not found in node %s", i, en.execNode.GetName())
}
if err := outPorts[i].setAnyVale(outPortArgs[i]); err != nil {
if err := outPorts[i+startOutIdx].setAnyVale(outPortArgs[i]); err != nil {
return fmt.Errorf("args %d set value error: %w", i, err)
}
}