Skip to content

Commit

Permalink
fix: optimize PipeXXX calls
Browse files Browse the repository at this point in the history
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
  • Loading branch information
CarstenLeue committed Jan 31, 2024
1 parent 7d37596 commit b077fed
Show file tree
Hide file tree
Showing 3 changed files with 1,047 additions and 1,256 deletions.
9 changes: 7 additions & 2 deletions cli/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,15 @@ func generatePipe(f *os.File, i int) {
fmt.Fprintf(f, ", f%d F%d", j, j)
}
fmt.Fprintf(f, ") T%d {\n", i)
fmt.Fprintf(f, " return ")
for j := i; j >= 1; j-- {
fmt.Fprintf(f, "f%d(", j)
}
fmt.Fprintf(f, "t0")
for j := 1; j <= i; j++ {
fmt.Fprintf(f, " t%d := f%d(t%d)\n", j, j, j-1)
fmt.Fprintf(f, ")")
}
fmt.Fprintf(f, " return t%d\n", i)
fmt.Fprintf(f, "\n")
fmt.Fprintln(f, "}")
}

Expand Down

0 comments on commit b077fed

Please sign in to comment.