Skip to content

Commit

Permalink
brought back to more optimal hash set implementations for use in tran…
Browse files Browse the repository at this point in the history
…sitive closure
  • Loading branch information
jurgenvinju committed Jan 8, 2024
1 parent a5dfefc commit 22f2294
Show file tree
Hide file tree
Showing 3 changed files with 1,137 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import io.usethesource.vallang.IValue;
import io.usethesource.vallang.IValueFactory;
import io.usethesource.vallang.IWriter;
import io.usethesource.vallang.impl.util.collections.ShareableValuesHashSet;
import io.usethesource.vallang.type.Type;
import io.usethesource.vallang.util.AbstractTypeBag;
import io.usethesource.vallang.util.RotatingQueue;
Expand Down Expand Up @@ -593,13 +594,13 @@ private java.util.Set<IValue> computeClosureDelta() {
iLefts.put(leftValues);
interestingLeftSides.put(key, leftValues);

rightValues = new HashSet<>();
rightValues = new ShareableValuesHashSet();
potentialRightSides.put(key, rightValues);
}

leftValues.put(value);
if (rightValues == null) {
rightValues = new HashSet<>();
rightValues = new ShareableValuesHashSet();
}

rightValues.add(value);
Expand All @@ -609,7 +610,7 @@ private java.util.Set<IValue> computeClosureDelta() {
int nextSize = 0;

// Compute
final java.util.Set<IValue> newTuples = new HashSet<>();
final java.util.Set<IValue> newTuples = new ShareableValuesHashSet();
do {
Map<IValue, java.util.Set<IValue>> rightSides = potentialRightSides;
potentialRightSides = new HashMap<>();
Expand Down
Loading

0 comments on commit 22f2294

Please sign in to comment.