Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Make the code a little bit cleaner #1459

Merged
merged 1 commit into from
Mar 28, 2017

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