-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
perf: add AmountOfNoValidation
for DecCoins
#18440
perf: add AmountOfNoValidation
for DecCoins
#18440
Conversation
WalkthroughWalkthroughThe recent changes introduce a new function Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- types/dec_coin.go (2 hunks)
Additional comments: 2
types/dec_coin.go (2)
451-466: The new function
AmountOfNoValidation
is introduced to improve performance by skipping the validation of the denom. This function should only be used when the correctness of the denom is already assured.478-487: The logic of
AmountOfNoValidation
is correct. It uses binary search to find the denom in the sorted DecCoins, which is efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get a changelog?
@julienrbrt done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- CHANGELOG.md (1 hunks)
Additional comments: 1
CHANGELOG.md (1)
- 53-59: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [56-60]
The changes are well documented and provide clear links to the corresponding pull requests for further details. Ensure that the changes mentioned here align with the actual changes made in the code.
Description
This PR adds
AmountOfNoValidation
to theDecCoins
in a similar fashion as theCoins
struct. This improves performance by avoiding calling themustVerifyDenom
function on every call.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
make lint
andmake test
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking changeSummary by CodeRabbit