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

feat(Payroll): small SLOAD optimizations to _transferTokensAmount() #822

Merged
merged 2 commits into from
Apr 26, 2019

Conversation

sohkai
Copy link
Contributor

@sohkai sohkai commented Apr 25, 2019

This should avoid a few unnecessary SLOADs that result to the same state.

Copy link
Contributor

@facuspagnuolo facuspagnuolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

for (uint256 i = 0; i < allowedTokensArray.length; i++) {
address token = allowedTokensArray[i];
if (employee.allocation[token] != uint256(0)) {
uint128 exchangeRate = _getExchangeRate(token);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think dropping this line was not intentionally actually.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI failed due to a compilation error since exchangeRate it's not declared.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅 Yes... messed up the merge conflict. Fixed in 9a602f2.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.015% when pulling 9a602f2 on payroll-optimize-transfers into dbf5366 on master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.015% when pulling 9a602f2 on payroll-optimize-transfers into dbf5366 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.015% when pulling 9a602f2 on payroll-optimize-transfers into dbf5366 on master.

@facuspagnuolo facuspagnuolo merged commit 5f190c5 into master Apr 26, 2019
@facuspagnuolo facuspagnuolo deleted the payroll-optimize-transfers branch April 26, 2019 06:12
ramilexe pushed a commit to ConsiderItDone/aragon-apps that referenced this pull request Dec 9, 2021
…ragon#822)

* feat(Payroll): small SLOAD optimizations to _transferTokensAmount

* fix: put back accidentally deleted line from merge conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants