It's already declared as local here https://github.com/drkibitz/nvm/blob/2e9558cbf9990c0c0d596b0abfb219d59aded2b7/nvm.sh#L178

The nvm function is pretty long and hard to track its vars. Don't think we want to break the function up, and wasn't entirely sure of the best way to organize the local vars in there, so I tried to follow what's already there.