Skip to content

Commit b44aa64

Browse files
committed
Use each_with_object() in code gen. ftw
1 parent f865b51 commit b44aa64

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/opal/parser.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,14 +1248,12 @@ def arity_check(args, opt, splat, block_name, mid)
12481248
end
12491249

12501250
def process_args(exp, level)
1251-
args = []
1252-
1253-
exp.each do |a|
1251+
args = exp.each_with_object([]) do |a, obj|
12541252
a = a.to_sym
12551253
next if a.to_s == '*'
12561254
a = lvar_to_js a
12571255
@scope.add_arg a
1258-
args << a
1256+
obj << a
12591257
end
12601258

12611259
f(args.join(', '), exp)

0 commit comments

Comments
 (0)