Skip to content
Myr

[Refactor] `nvm_alias`: one-pass trailing whitespace strip

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Replace the per-character trailing-whitespace loop with a one-pass parameter expansion, per review.

authored by Jake Lodwick · committed by Jordan Harband · parent 304a22a · Browse files · 1 file+1 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−6 removed

  • other:+1 added−6 removed

1 file+1 added−6 removed

modified:nvm.sh+1 added-6 removed
1375 unmodified lines
1376 case "${NVM_ALIAS_LINE}" in1377 *[![:space:]]*) ;;1378 *) continue ;;1379 esac1380 while : ; do1381 case "${NVM_ALIAS_LINE}" in1382 *[[:space:]]) NVM_ALIAS_LINE="${NVM_ALIAS_LINE%[[:space:]]}" ;;1383 *) break ;;1384 esac1385 done1380 NVM_ALIAS_LINE="${NVM_ALIAS_LINE%"${NVM_ALIAS_LINE##*[![:space:]]}"}"1381 nvm_echo "${NVM_ALIAS_LINE}"1382 done < "${NVM_ALIAS_PATH}"1383}1384
3554 unmodified lines