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

correct logic in perfect..min size search #30

Merged
merged 2 commits into from
Oct 24, 2017
Merged

Conversation

kspearrin
Copy link
Contributor

@kspearrin kspearrin commented Oct 14, 2017

I believe I found the error in your logic for determining the correct min size. You have a comment there that describes what you wanted, but the logic did not match.

The current code does not compare against the max or perfect range when searching for the biggest icon that is > min. Since the icons are sorted in descending order for this iterator, you will always get the largest icon from the list (which is the first one in the for loop). This confirms the behavior I am seeing in #28.

Note: I am not a go developer and I was not able to run and test this code. I do, however, know how to read boolean logic 😃 . Please double check my work and syntax (I just copy/pasted and tweaked from the above logic).

resolves #28

@mat mat merged commit 8795fa2 into mat:master Oct 24, 2017
@mat
Copy link
Owner

mat commented Oct 24, 2017

Wow, what a good catch, thank you!

I'm going to add a test for this and add you to the list of contributors.

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