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

[Audit] Q-3 - Usage of saturating_sub vs checked_sub #321

Merged
merged 3 commits into from
Jan 1, 2024

Conversation

crypto-vincent
Copy link
Contributor

@crypto-vincent crypto-vincent commented Dec 24, 2023

Replacing this kind of logic:

if a < b {
   return 0;
}
return checked_sub(a, b);

by:

return a.saturating_sub(b);

When possible

@crypto-vincent crypto-vincent self-assigned this Dec 24, 2023
@crypto-vincent crypto-vincent changed the title [Audit] Q-3 Usage of saturating_sub vs checked_sub [Audit] Q-3 - Usage of saturating_sub vs checked_sub Dec 24, 2023
@crypto-vincent
Copy link
Contributor Author

CI is broken due to mercurial's breaking change on devnet. Tested manually on localnet once again before merging to develop 👌 .

@crypto-vincent crypto-vincent merged commit 6d7895d into develop Jan 1, 2024
8 of 11 checks passed
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