Skip to content
Snippets Groups Projects
Commit b258bee4 authored by Jack Nagel's avatar Jack Nagel
Browse files

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.
parent 3c73cc28
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,7 @@ class Formula
end
def prefix
HOMEBREW_CELLAR/name/version
HOMEBREW_CELLAR+name+version
end
def rack; prefix.parent end
......
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment