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

Optimized mask creation in draw calc #215

Merged
merged 2 commits into from
Oct 14, 2021

Conversation

asselstine
Copy link
Contributor

@asselstine asselstine commented Oct 14, 2021

@PierrickGT PierrickGT self-assigned this Oct 14, 2021
for (uint8 maskIndex = 0; maskIndex < _prizeDistribution.matchCardinality; maskIndex++) {
// create mask of width bitRangeSize bits at index
uint256 _matchIndexOffset = uint256(maskIndex) * uint256(_prizeDistribution.bitRangeSize);
if(_prizeDistribution.matchCardinality == 0) return masks;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(_prizeDistribution.matchCardinality == 0) return masks;
if (_prizeDistribution.matchCardinality == 0) {
return masks;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

matchCardinality cannot be 0 so removing this

@asselstine
Copy link
Contributor Author

@asselstine asselstine merged commit 9d0ca8e into master Oct 14, 2021
@asselstine asselstine deleted the pool-1787-gas-bitmasks-creation-can-be-simplified branch October 14, 2021 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants