From f0b75b286957f7ba012461492f1635a13a5dbe16 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 9 Aug 2014 10:30:43 -0500 Subject: [PATCH] Stop duping options when duping the build object The options collection cannot be mutated from the build object, so it can be shared among copies safely. --- Library/Homebrew/build_options.rb | 2 -- Library/Homebrew/test/test_build_options.rb | 6 ------ 2 files changed, 8 deletions(-) diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index 28fbb959c4..b04c9dc1dc 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -7,7 +7,6 @@ class BuildOptions attr_accessor :args attr_accessor :universal - attr_reader :options def initialize(args, options) @args = Options.coerce(args) @@ -16,7 +15,6 @@ class BuildOptions def initialize_copy(other) super - @options = other.options.dup @args = other.args.dup end diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/test_build_options.rb index 11b3145bad..4fa332230d 100644 --- a/Library/Homebrew/test/test_build_options.rb +++ b/Library/Homebrew/test/test_build_options.rb @@ -37,12 +37,6 @@ class BuildOptionsTests < Homebrew::TestCase assert_includes @build.unused_options, "--without-baz" end - def test_copies_do_not_share_underlying_options - orig = BuildOptions.new [], Options.new - copy = orig.dup - refute_same orig.options, copy.options - end - def test_copies_do_not_share_underlying_args orig = BuildOptions.new [], Options.new copy = orig.dup