We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi guys, great work, I am currently checking out the contracts code,
and wondering if it is better to have many if conditions like:
function getUnderlyingIndex(address underlying) internal view returns (uint) { if (underlying == underlying00) return 0; if (underlying == underlying01) return 1; if (underlying == underlying02) return 2; if (underlying == underlying03) return 3; if (underlying == underlying04) return 4; if (underlying == underlying05) return 5; if (underlying == underlying06) return 6; ...
for underlying, symbols, cTokens than having mappings like(pseudo-code here):
underlyingAddress => TokenConfig; symbols => TokenConfig; cTokenAddress => TokenConfig;
i mean using ifs means you will need to go through 0 - 5 to get the 06 index every time right?
I'm just green in solidity coding, so hoping to get some insights here.
Many thanks.
The text was updated successfully, but these errors were encountered:
in order to use immutable values rather than storage reads, the if statements are necessary. This makes for lower gas costs
Sorry, something went wrong.
No branches or pull requests
Hi guys, great work, I am currently checking out the contracts code,
and wondering if it is better to have many if conditions like:
for underlying, symbols, cTokens
than having mappings like(pseudo-code here):
i mean using ifs means you will need to go through 0 - 5 to get the 06 index every time right?
I'm just green in solidity coding, so hoping to get some insights here.
Many thanks.
The text was updated successfully, but these errors were encountered: