From abbed076f091e6420734bda094dc13527f4e1620 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Wed, 19 Feb 2014 16:53:18 -0500 Subject: [PATCH] Pass path into the Formula constructor When the path argument to the Formula constructor is omitted, the instance's path attribute is created using the Formula.path class method. However, we have already done this work, so we can just pass it into the constructor. This translates to one less call to Pathname#to_s per formula, or about 2600 calls when running `brew readall`. --- Library/Homebrew/formulary.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index d5e4fde224..8066e01812 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -94,7 +94,7 @@ class Formulary end def get_formula - return klass.new(name) + klass.new(name, path) end end