Skip to content

Commit 9cdd09c

Browse files
committed
[API] Generator: Use array to store already used paths
1 parent fe17ff0 commit 9cdd09c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

elasticsearch-api/utils/thor/generate_source.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ def __http_path
154154
return termvectors_path if @method_name == 'termvectors'
155155

156156
result = ''
157-
anchor_string = ''
157+
anchor_string = []
158158
@paths.sort { |a, b| b.length <=> a.length }.each_with_index do |path, i|
159159
var_string = __extract_path_variables(path).map { |var| "_#{var}" }.join(' && ')
160-
next if anchor_string == var_string
160+
next if anchor_string.include? var_string
161161

162-
anchor_string = var_string
162+
anchor_string << var_string
163163
result += if i.zero?
164164
"if #{var_string}\n"
165165
elsif (i == @paths.size - 1) || var_string.empty?

0 commit comments

Comments
 (0)