Skip to content

Commit

Permalink
Fix CME
Browse files Browse the repository at this point in the history
Fixes #273
  • Loading branch information
valis committed Oct 10, 2020
1 parent 70c7cce commit 11ef7d6
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
import org.arend.typechecking.visitor.CollectDefCallsVisitor;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class DependencyCollector implements DependencyListener {
private final Map<TCReferable, Set<TCReferable>> myDependencies = new HashMap<>();
private final Map<TCReferable, Set<TCReferable>> myReverseDependencies = new HashMap<>();
private final Map<TCReferable, Set<TCReferable>> myDependencies = new ConcurrentHashMap<>();
private final Map<TCReferable, Set<TCReferable>> myReverseDependencies = new ConcurrentHashMap<>();

@Override
public void dependsOn(TCReferable def1, TCReferable def2) {
Expand All @@ -23,9 +24,9 @@ public void dependsOn(TCReferable def1, TCReferable def2) {
}

if (!(def1 instanceof MetaDefinition)) {
myDependencies.computeIfAbsent(def1, k -> new HashSet<>()).add(def2);
myDependencies.computeIfAbsent(def1, k -> ConcurrentHashMap.newKeySet()).add(def2);
}
myReverseDependencies.computeIfAbsent(def2, k -> new HashSet<>()).add(def1);
myReverseDependencies.computeIfAbsent(def2, k -> ConcurrentHashMap.newKeySet()).add(def1);
}

@Override
Expand Down

0 comments on commit 11ef7d6

Please sign in to comment.