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

Lookup lower distances if there's space #165

Merged
merged 6 commits into from
Nov 3, 2022

Conversation

jtraglia
Copy link
Contributor

@jtraglia jtraglia commented Nov 2, 2022

PR Description

Alternative version of #164 based on this comment. We want to prioritize higher distances, but...

It would be reasonable to add lower distances if we've reached MAX_DISTANCE though.

This PR does exactly that.

Because it used the same offset, when it reached the maximum distance it would
start adding values that were not adjacent to the target distance. For example,
it would produce `[255, 256, 252, 251]` which is obviously wrong.
Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

LGTM just a couple of minor simplifications I'd suggest.

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@ajsutton ajsutton merged commit a861f97 into Consensys:master Nov 3, 2022
@jtraglia jtraglia deleted the add-lower-distances branch November 3, 2022 00:49
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.

2 participants