Skip to content

Conversation

aalavandhan
Copy link
Member

Replacing if statement with ternary operator in the decrease allowance function

@aalavandhan aalavandhan mentioned this pull request Feb 12, 2021
} else {
newValue = oldValue.sub(subtractedValue);
}
uint256 newValue = subtractedValue >= oldValue ? 0 : oldValue.sub(subtractedValue);
Copy link
Member

Choose a reason for hiding this comment

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

Minor, but I like the style that puts parens around the ternary operator's condition clause.

@aalavandhan aalavandhan merged commit 1a3245b into master Feb 15, 2021
@aalavandhan aalavandhan deleted the allowance-fn-fix branch February 15, 2021 15:05
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.

3 participants