Skip to content

Commit c9b1c56

Browse files
committed
Simplify load_alternatives from config
1 parent ca2c402 commit c9b1c56

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/split/experiment_storage.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,9 @@ def exists?
5757
def load_alternatives
5858
alts = Split.configuration.experiment_for(@name)[:alternatives]
5959
raise ArgumentError, "Experiment configuration is missing :alternatives array" unless alts
60-
if alts.is_a?(Hash)
61-
alts.keys
62-
else
63-
alts.flatten
64-
end
60+
61+
alts = alts.keys if alts.is_a?(Hash)
62+
alts.flatten
6563
end
6664

6765
def load_metadata

0 commit comments

Comments
 (0)