Small loop refactor to make Slither happier#90
Merged
Merged
Conversation
The loop should work exactly the same as before except that we avoid the comparison of bits >= 0 which is always true because bits is an uint.
Initializing the index does not change how the function works and, in fact, index when not initialized is initialized to the default - 0 value. We can however make this code a little cleaner and Slither happier.
eth-r
approved these changes
Aug 21, 2020
Shadowfiend
approved these changes
Aug 24, 2020
Shadowfiend
left a comment
Contributor
There was a problem hiding this comment.
Looks good here, let's do it.
nkuba
added a commit
that referenced
this pull request
Aug 28, 2020
Bumping up version to 1.1.1 for a new release The new release will contain no functionality changes but will re-organize the code based on Linter and Slither suggestions: - Update linting configuration #87 - Small loop refactor to make Slither happier #90 - Renamed input parameters to Leaf.make function to avoid shadowing #91 See https://github.com/keep-network/sortition-pools/milestone/4?closed=1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addressing two issues reported by Slither:
Addressed in d7025e2 by refacoring the loop. The loop should work exactly the same as before except that we avoid the
comparison of
bits >= 0which is alwaystruebecausebitsis anuint.Addressed in 5588f31 by initializing the
index. It does not change how the function works and, infact, index, when not initialized, is initialized to the default - 0 value. We can however make this code a little cleaner and Slither happier.