Skip to content

Commit c600680

Browse files
committed
nits: Extract to char_var_count, chars_var_count
1 parent 1e59dc5 commit c600680

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

_tools/ruby_h_to_go/lib/ruby_h_to_go/function_definition.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ def generate_function_header_lines
7676
# - after_call_function_lines [Array<String>]
7777
def analyze_args
7878
casted_go_args = []
79-
char_var_count = args.count { |c_arg| c_arg.type == "char" && c_arg.pointer == :ref }
80-
chars_var_count = args.count { |c_arg| c_arg.type == "char" && c_arg.pointer == :str_array }
81-
8279
before_call_function_lines = []
8380
after_call_function_lines = []
8481

@@ -93,6 +90,16 @@ def analyze_args
9390
[casted_go_args, before_call_function_lines, after_call_function_lines]
9491
end
9592

93+
# @return [Integer]
94+
def char_var_count
95+
args.count { |c_arg| c_arg.type == "char" && c_arg.pointer == :ref }
96+
end
97+
98+
# @return [Integer]
99+
def chars_var_count
100+
args.count { |c_arg| c_arg.type == "char" && c_arg.pointer == :str_array }
101+
end
102+
96103
# @param go_function_lines [Array<String>]
97104
# @param call_c_method [String]
98105
# @param before_call_function_lines [Array<String>]

0 commit comments

Comments
 (0)