Skip to content

Commit 48757be

Browse files
committed
copilot
1 parent e7b31b4 commit 48757be

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

core/src/main/java/ai/timefold/solver/core/impl/bavet/common/AbstractIndexedIfExistsNode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ public final void retractLeft(LeftTuple_ leftTuple) {
173173
private void removeFromIndexerLeft(Object compositeKey, LeftTuple_ leftTuple,
174174
ListEntry<ExistsCounter<LeftTuple_>> counterEntry, boolean keepBucket) {
175175
if (useFusedEqualIndex) {
176-
Bucket<ExistsCounter<LeftTuple_>, UniTuple<Right_>> bucket = leftTuple.getStore(inputStoreIndexLeftBucket);
176+
Bucket<ExistsCounter<LeftTuple_>, UniTuple<Right_>> bucket =
177+
keepBucket ? leftTuple.getStore(inputStoreIndexLeftBucket) : leftTuple.removeStore(inputStoreIndexLeftBucket);
177178
bucket.removeLeft(compositeKey, counterEntry);
178179
if (!keepBucket) { // keepBucket: a same-bucket changed-key update re-adds immediately, so don't drop it.
179180
fusedEqualIndex.removeBucketIfEmpty(compositeKey, bucket);

core/src/test/java/ai/timefold/solver/core/impl/bavet/common/index/ComparisonIndexerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* Comparison is otherwise only exercised alongside a leading equal (see {@link EqualsAndComparisonIndexerTest});
1515
* a pure-comparison join takes the {@code useJoinIndex == false} branch and must still join correctly.
1616
* <p>
17-
* A single comparison joiner uses a {@link SingleKeyUnpacker}, so the index key is the raw (comparable) key,
18-
* not a {@link CompositeKey}; the tests put/query with raw keys accordingly.
17+
* A single comparison joiner uses a {@link KeyUnpacker#single()},
18+
* so the index key is the raw (comparable) key, not a {@link CompositeKey};
19+
* the tests put/query with raw keys accordingly.
1920
*/
2021
class ComparisonIndexerTest extends AbstractIndexerTest {
2122

0 commit comments

Comments
 (0)