Skip to content

Commit 5a7d96b

Browse files
authored
Merge pull request #5325 from rmosolgo/fix-vis-for-large-lists
Visibility: better duplicate name lookup
2 parents ddf2550 + e2dfdf5 commit 5a7d96b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: lib/graphql/schema/visibility/profile.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,11 @@ def visible_enum_value?(enum_value, _ctx = nil)
281281

282282
def non_duplicate_items(definitions, visibility_cache)
283283
non_dups = []
284+
names = Set.new
284285
definitions.each do |defn|
285286
if visibility_cache[defn]
286-
if (dup_defn = non_dups.find { |d| d.graphql_name == defn.graphql_name })
287+
if !names.add?(defn.graphql_name)
288+
dup_defn = non_dups.find { |d| d.graphql_name == defn.graphql_name }
287289
raise_duplicate_definition(dup_defn, defn)
288290
end
289291
non_dups << defn

0 commit comments

Comments
 (0)