-
Notifications
You must be signed in to change notification settings - Fork 19
Fix early exit from validation before all terms are used #3
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the analysis and fix!
Was wondering if the input was always structured so that I could wing it using the test_value as a failure, now we know. 🙂
Your fix also improved the benchmark from 220 μs to 147 μs. Kudos!
Updated my comment in the solution megathread to credit your fix.
You're the first contributor to this repo!
I'm learning rust, came across your repository and have used it as the basis of my own to learn from.
Thankyou so much for making it public, I'm learning a lot by it.
For Day07, I managed part 1, but part 2 broke me and I looked to your repo for inspiration.
However it didn't work on my Part1 data.
I compared the lines that were different and found that on 2 of my input lines, your code has a false positive.
The valid function is returning a match before it has exhausted all terms. In both cases it finds that the target is reached before considering the first digit in the list (i.e. the final term isn't considered).
I've added a naive simple fix, you may want to make it more compact.
Again many thanks for your repo, it's been an inspiration, as I normally do this in Kotlin, but this year tried to pick up rust again (my second attempt in last few years).