Skip to content

Commit 4aa2fa2

Browse files
refactor function argument handling for better readability
1 parent 898dd5a commit 4aa2fa2

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/code/object/function.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ def code_call(*arguments, **globals)
5656
.raw
5757
.select { |code_argument| code_argument.is_a?(Dictionary) }
5858
.detect do |code_dictionary|
59-
code_dictionary.code_has_key?(code_parameter.code_name).truthy?
59+
code_dictionary.code_has_key?(
60+
code_parameter.code_name
61+
).truthy?
6062
end
6163
&.code_get(code_parameter.code_name)
6264
.to_code
6365
else
6466
code_arguments.raw[index].to_code
6567
end
6668

67-
if code_argument.nothing?
68-
code_argument = code_parameter.code_default
69-
end
69+
code_argument = code_parameter.code_default if code_argument.nothing?
7070

7171
code_context.code_set(code_parameter.code_name, code_argument)
7272
end

0 commit comments

Comments
 (0)