From 108f630732cad7a12a1aecf941d171daf9d94908 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sat, 4 Apr 2015 14:31:56 -0700 Subject: [PATCH] Cache the `nvm_node_prefix` call. --- nvm.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 2d1a221..3723b8d 100755 --- a/nvm.sh +++ b/nvm.sh @@ -222,8 +222,10 @@ nvm_version() { return $? fi + local NVM_NODE_PREFIX + NVM_NODE_PREFIX="$(nvm_node_prefix)" case "_$PATTERN" in - "_$(nvm_node_prefix)" | "_$(nvm_node_prefix)-") + "_$NVM_NODE_PREFIX" | "_$NVM_NODE_PREFIX-") PATTERN="stable" ;; esac