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.
This commit is contained in:
Jack Nagel 2014-04-06 18:39:29 -05:00
parent da2a2ab748
commit c1366b111f

View File

@ -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,