From 9e7f5dc2619839a17dbceb01c6708bab7753e73f Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 7 Jul 2014 09:15:56 -0500 Subject: Merge instead of calling << in a loop --- Library/Homebrew/build_environment.rb | 6 +++++- Library/Homebrew/options.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb index e6dbf9734..d46e4bfb2 100644 --- a/Library/Homebrew/build_environment.rb +++ b/Library/Homebrew/build_environment.rb @@ -6,6 +6,10 @@ class BuildEnvironment @procs = Set.new end + def merge(*args) + @settings.merge(*args) + end + def <<(o) case o when Proc then @procs << o @@ -41,7 +45,7 @@ module BuildEnvironmentDSL if block_given? @env << block else - settings.each { |s| @env << s } + @env.merge(settings) end @env end diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb index d273239bb..3988085ce 100644 --- a/Library/Homebrew/options.rb +++ b/Library/Homebrew/options.rb @@ -104,7 +104,7 @@ class Options end def concat(o) - o.each { |opt| @options << opt } + @options.merge(o) self end -- cgit v1.2.3