Skip to content

Commit 392fc20

Browse files
committed
tighten
1 parent 1161c4a commit 392fc20

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/manifold/api/schema_manager.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,14 @@ def generate_breakout_intersection_fields(group_config)
166166
end
167167

168168
def generate_intersections(group_config)
169-
intersections = []
170169
breakout_groups = group_config["breakouts"].keys
171170

172-
# Generate combinations of different sizes (2 to n breakout groups)
173-
(2..breakout_groups.size).each do |combination_size|
174-
add_combinations_of_size(combination_size, breakout_groups, group_config, intersections)
171+
# Generate all valid combinations of breakout groups (sizes 2 to n)
172+
(2..breakout_groups.size).flat_map do |size|
173+
breakout_groups.combination(size).flat_map do |combo|
174+
generate_intersection_fields_for_combination(group_config, combo)
175+
end
175176
end
176-
177-
intersections
178177
end
179178

180179
def add_combinations_of_size(size, breakout_groups, group_config, all_fields)

0 commit comments

Comments
 (0)