diff options
| author | Jack Nagel | 2013-04-14 20:09:19 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-04-14 20:09:20 -0500 |
| commit | b258bee44ea3783319ee616168389ed7b9ce5096 (patch) | |
| tree | 2a248dd0afedf495aeed480b2bf59522a8f5f23d | |
| parent | 3c73cc28e0bf12d54f344135b35c5af8feaf0a77 (diff) | |
| download | brew-b258bee44ea3783319ee616168389ed7b9ce5096.tar.bz2 | |
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.
| -rw-r--r-- | Library/Homebrew/formula.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula_pin.rb | 4 |
2 files changed, 3 insertions, 3 deletions
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) |
