Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Reduce repeated checks in the SupplyLogic.sol#847

Open
tanliwei wants to merge 1 commit intoaave:masterfrom
tanliwei:patch-1
Open

Reduce repeated checks in the SupplyLogic.sol#847
tanliwei wants to merge 1 commit intoaave:masterfrom
tanliwei:patch-1

Conversation

@tanliwei
Copy link

@tanliwei tanliwei commented May 5, 2023

Merge two if branches into a two-level if branches to save gas without changing the logic.

The only case in this PR not covered is when the passed-in parameter params.amount equal to userBalance that is IAToken(reserveCache.aTokenAddress).scaledBalanceOf(msg.sender).rayMul(reserveCache.nextLiquidityIndex);

This pr is ok if only the value type(uint256).max stands for withdraw all asset.

Merge two `if` branches into two-level `if` branches to save gas without changing the logic.
@height
Copy link

height bot commented May 5, 2023

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@tanliwei tanliwei requested a review from sakulstra as a code owner May 5, 2023 10:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant