Skip to content

Commit 8bb3503

Browse files
committed
Cache environment variable separator in local variable
1 parent b9d25f7 commit 8bb3503

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/config/options.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ def reload_env!
3737
hash = Hash.new
3838

3939
ENV.each do |variable, value|
40-
keys = variable.to_s.split(Config.env_separator)
40+
separator = Config.env_separator
41+
prefix = (Config.env_prefix || Config.const_name).to_s.split(separator)
4142

42-
prefix = (Config.env_prefix || Config.const_name).split(Config.env_separator)
43+
keys = variable.to_s.split(separator)
4344

4445
next if keys.shift(prefix.size) != prefix
4546

0 commit comments

Comments
 (0)