From b258bee44ea3783319ee616168389ed7b9ce5096 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 14 Apr 2013 20:09:19 -0500 Subject: Don't use Pathname#/ in performance-critical code This method (well, really, #join) is *twice* as slow as simple concatenation, and shouldn't really be used at all in non-Formula code. --- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/formula_pin.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 420203167..494024278 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -143,7 +143,7 @@ class Formula end def prefix - HOMEBREW_CELLAR/name/version + HOMEBREW_CELLAR+name+version end def rack; prefix.parent end diff --git a/Library/Homebrew/formula_pin.rb b/Library/Homebrew/formula_pin.rb index eaf1888f9..c809a02b8 100644 --- a/Library/Homebrew/formula_pin.rb +++ b/Library/Homebrew/formula_pin.rb @@ -1,13 +1,13 @@ require 'fileutils' class FormulaPin - HOMEBREW_PINNED = HOMEBREW_LIBRARY/'PinnedKegs' + HOMEBREW_PINNED = HOMEBREW_LIBRARY+'PinnedKegs' def initialize(formula) @formula = formula @name = formula.name HOMEBREW_PINNED.mkdir unless HOMEBREW_PINNED.exist? - @path = HOMEBREW_PINNED/@name + @path = HOMEBREW_PINNED+@name end def pin_at(version) -- cgit v1.2.3