Skip to content

Conversation

PeterDaveHello
Copy link
Collaborator

No description provided.

@@ -726,8 +724,7 @@ nvm_resolve_alias() {
break
fi

if [ -n "${ALIAS_TEMP}" ] \
&& command printf "${SEEN_ALIASES}" | nvm_grep -e "^${ALIAS_TEMP}$" > /dev/null; then
if command printf "${SEEN_ALIASES}" | nvm_grep -e "^${ALIAS_TEMP}$" > /dev/null; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this change? If ALIAS_TEMP is empty, we shouldn't need to run the printf or grep.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above code is doing that right?

    if [ -z "${ALIAS_TEMP}" ]; then
      break
    fi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

touche, i guess i didn't trust break :-p

@@ -726,8 +724,7 @@ nvm_resolve_alias() {
break
fi

if [ -n "${ALIAS_TEMP}" ] \
&& command printf "${SEEN_ALIASES}" | nvm_grep -e "^${ALIAS_TEMP}$" > /dev/null; then
if command printf "${SEEN_ALIASES}" | nvm_grep -e "^${ALIAS_TEMP}$" > /dev/null; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

touche, i guess i didn't trust break :-p

@ljharb ljharb merged commit 059ab0e into nvm-sh:master Mar 28, 2017
@PeterDaveHello PeterDaveHello deleted the minor-refactor branch March 28, 2017 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants