aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-04-06 18:39:29 -0500
committerJack Nagel2014-04-06 18:41:27 -0500
commitc1366b111f866a2a4e03ce606b52f93b1de10fdb (patch)
tree46c0bdf0ec074f0a498c96aa6b52168aa2834ed6
parentda2a2ab74899a659ba8fe5e9c178fb3c409d8d37 (diff)
downloadbrew-c1366b111f866a2a4e03ce606b52f93b1de10fdb.tar.bz2
Initialize cxxstdlib set lazily
This is used rarely and only at build-time, so we don't need to create it when instantiating the formula.
-rw-r--r--Library/Homebrew/formula.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 398f14413..49271b76d 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -26,10 +26,6 @@ class Formula
attr_accessor :local_bottle_path
- # Flag for marking whether this formula needs C++ standard library
- # compatibility check
- attr_reader :cxxstdlib
-
# Homebrew determines the name
def initialize name='__UNKNOWN__', path=self.class.path(name)
@name = name
@@ -47,8 +43,6 @@ class Formula
@pkg_version = PkgVersion.new(version, revision)
@pin = FormulaPin.new(self)
-
- @cxxstdlib = Set.new
end
def set_spec(name)
@@ -445,6 +439,12 @@ class Formula
Requirement.expand(self, &block)
end
+ # Flag for marking whether this formula needs C++ standard library
+ # compatibility check
+ def cxxstdlib
+ @cxxstdlib ||= Set.new
+ end
+
def to_hash
hsh = {
"name" => name,