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`.
This commit is contained in:
Jack Nagel 2014-02-19 16:53:18 -05:00
parent 1f39d6c2d1
commit abbed076f0

View File

@ -94,7 +94,7 @@ class Formulary
end end
def get_formula def get_formula
return klass.new(name) klass.new(name, path)
end end
end end