Skip to content

Commit 4db8e93

Browse files
committed
chore: cleanup
1 parent 9fc66f8 commit 4db8e93

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

mypyc/irbuild/ll_builder.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -790,12 +790,15 @@ def _construct_varargs(
790790
if star_result is None:
791791
# fast path if star expr is a tuple:
792792
# we can pass the immutable tuple straight into the function call.
793-
if is_tuple_rprimitive(value.type) and (
794-
len(args) == 1 or (len(args) == 2 and args[1][1] == ARG_STAR2)
795-
): # only matches fn(*args) and fn(*args, **kwargs)
793+
if is_tuple_rprimitive(value.type):
794+
if len(args) == 1:
795+
# fn(*args)
796+
return value, None
797+
elif len(args) == 2 and args[1][1] == ARG_STAR2:
798+
# fn(*args, **kwargs)
799+
star_result = value
800+
continue
796801
# TODO extend this to optimize fn(*args, k=1, **kwargs) case
797-
star_result = value
798-
continue
799802
else:
800803
# TODO optimize this case using the length utils - currently in review
801804
star_result = self.new_list_op(star_values, line)

0 commit comments

Comments
 (0)