From c1366b111f866a2a4e03ce606b52f93b1de10fdb Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 6 Apr 2014 18:39:29 -0500 Subject: 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. --- Library/Homebrew/formula.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Library') 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, -- cgit v1.2.3