[performance] `nvm_auto`: only call `nvm_ls_current` in `use` mode
diff --git a/nvm.sh b/nvm.sh
index 11a24fa..4a95dc5 100644
--- a/nvm.sh
+++ b/nvm.sh
@@ -3788,11 +3788,10 @@
 }
 
 nvm_auto() {
-  local NVM_CURRENT
-  NVM_CURRENT="$(nvm_ls_current)"
   local NVM_MODE
   NVM_MODE="${1-}"
   local VERSION
+  local NVM_CURRENT
   if [ "_${NVM_MODE}" = '_install' ]; then
     VERSION="$(nvm_alias default 2>/dev/null || nvm_echo)"
     if [ -n "${VERSION}" ]; then
@@ -3801,6 +3800,7 @@
       nvm install >/dev/null
     fi
   elif [ "_$NVM_MODE" = '_use' ]; then
+    NVM_CURRENT="$(nvm_ls_current)"
     if [ "_${NVM_CURRENT}" = '_none' ] || [ "_${NVM_CURRENT}" = '_system' ]; then
       VERSION="$(nvm_resolve_local_alias default 2>/dev/null || nvm_echo)"
       if [ -n "${VERSION}" ]; then