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

[CodeArena] - [G-04] : For uint replace > 0 with != 0 #72

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

maximebrugel
Copy link
Contributor

@maximebrugel maximebrugel added the To review Let people know this PR is ready for a review label Dec 14, 2021
Comment on lines 95 to 96
while (operators[i] != operator) {
i++;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when i is greater than operators.length? Does the loop continue until the tx run out of gas?

I think a more elegant logic would be a for loop that counts down from operators.length to 0. wdyt?
Moreover, when we remove an operator, I believe it is more likely to be the last one added

Copy link
Contributor

Choose a reason for hiding this comment

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

This is out of scope of this PR, but still.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a CodeArena issue, will be fixed :)

@maximebrugel maximebrugel added Can merge Good to go and removed To review Let people know this PR is ready for a review labels Dec 20, 2021
@maximebrugel maximebrugel merged commit 209adc3 into codearena Dec 21, 2021
@maximebrugel maximebrugel deleted the codearena-8 branch December 21, 2021 16:11
maximebrugel added a commit that referenced this pull request Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can merge Good to go
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants