Skip to content

Commit a934699

Browse files
committed
avoid useless list creation
1 parent 98d0507 commit a934699

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

synth/syntax/type_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def FunctionType(*args: Type) -> Type:
3131
"""
3232
Short-hand to create n-ary functions.
3333
"""
34-
types = list(args)
35-
base = types.pop()
36-
while types:
37-
base = Arrow(types.pop(), base)
34+
n = len(args) - 1
35+
base = args[-1]
36+
for i in range(n - 1, -1, -1):
37+
base = Arrow(args[i], base)
3838
return base
3939

4040

0 commit comments

Comments
 (0)