From daedfcab510b01d566a2dff6bc94a9e91a563a18 Mon Sep 17 00:00:00 2001 From: Gabe Martin-Dempesy Date: Sat, 15 Aug 2015 12:54:46 -0700 Subject: [PATCH] reduce rbenv plugin load time by 150ms by removing additional brew call --- plugins/rbenv/rbenv.plugin.zsh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh index 213e1beb0..ef5106f2d 100644 --- a/plugins/rbenv/rbenv.plugin.zsh +++ b/plugins/rbenv/rbenv.plugin.zsh @@ -2,14 +2,11 @@ _homebrew-installed() { type brew &> /dev/null } -_rbenv-from-homebrew-installed() { - brew --prefix rbenv &> /dev/null -} - FOUND_RBENV=0 rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv") -if _homebrew-installed && _rbenv-from-homebrew-installed ; then - rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}") +if _homebrew-installed && rbenv_homebrew_path=$(brew --prefix rbenv 2>/dev/null); then + rbenvdirs=($rbenv_homebrew_path "${rbenvdirs[@]}") + unset rbenv_homebrew_path fi for rbenvdir in "${rbenvdirs[@]}" ; do