Skip to content

Conversation

lonyelon
Copy link

Simplify "if" conditionals by removing the unnecessary "if", "then" and "fi" from those with only one line of code inside them.

Example, this conditional...

if CONDITION; then
    A
else
    B
fi

...is the same as:

CONDITION && A || B

Aesthetic PR, feel free to ignore :).

@lonyelon lonyelon changed the title Simpify "if"s conditionals Simpify one-liner "if" conditionals Apr 28, 2023
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.

1 participant