-
Notifications
You must be signed in to change notification settings - Fork 98
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
fix: Use inserted range when retracting range in toConnectedRanges
#1056
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.
We need a different test.
Otherwise LGTM.
final var mapped = mapper.apply(a, b); | ||
final var saved = calculator.insert(mapped); |
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.
final
shouldn't be necessary here. The variable is effectively final without it too.
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.
I prefer final to explicitly mark it as final/as something that shouldn't be changed.
final var mapped = mapper.apply(a, b, c, d); | ||
final var saved = calculator.insert(mapped); |
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.
Dtto.
final var mapped = mapper.apply(a, b, c); | ||
final var saved = calculator.insert(mapped); |
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.
Dtto.
final var mapped = mapper.apply(a); | ||
final var saved = calculator.insert(mapped); |
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.
Dtto.
...fold/solver/core/impl/score/stream/collector/connected_ranges/ConnectedRangeSolvingTest.java
Outdated
Show resolved
Hide resolved
The `ConnectedRangesCalculator` incorrectly assumes the range for each value is constant. The fix is to save the range on insert, and then pass the saved range on retract. The other calculators do not have this problem, because either: - Their input should be immutable (ex: number) - They used a map in their internal data structure that saved the original value
d1053aa
to
9167c5c
Compare
Quality Gate failedFailed conditions |
The
ConnectedRangesCalculator
incorrectly assumes the range for each value is constant. The fix is to save the range on insert, and then pass the saved range on retract. The other calculators do not have this problem, because either:Fixes #953