-
Notifications
You must be signed in to change notification settings - Fork 63
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
performance: remove extra conversions and optimize functions #553
Conversation
9e8b54a
to
2d1425e
Compare
e83c50b
to
b04f843
Compare
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.
Please also change skipNonceDestinationAddress = map[string]bool
to skipNonceDestinationAddress = map[common.Address]bool
or skipNonceDestinationAddress = map[common.Address]struct{}
. The latter one is better.
5832c40
to
3e8f4bf
Compare
1193d82
to
80a687e
Compare
f5af2f7
to
bc47c26
Compare
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.
LGTM
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.
Good Improvement
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.
Good improvement
Proposed changes
Example 1
quoteToken
as string, convertscommon.XDCNativeAddress
hex to addresscommon.XDCNativeAddressBinary
by binary form, fetches price without conversion.Example 2
token
string equality withcommon.XDCNativeAddress
and log with string conversions.token
known asXDCNativeAddress
, use its string type directly.Example 3
To()
function to retrieve the same result in the logic.tx.To()
is stored in a variable for reuse, leading to a more streamlined and easily comprehensible code structure.Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅
in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅
in the boxes that applyChecklist
Put an
✅
in the boxes once you have confirmed below actions (or provide reasons on not doing so) that