TreeMap must be used for variables as they don't implement hashCode

This commit is contained in:
serso 2016-04-03 00:46:40 +02:00
parent b1eb2c7d37
commit f5a9f30e04

View File

@ -8,7 +8,6 @@ import jscl.mathml.MathML;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
@ -383,7 +382,7 @@ public class Literal implements Comparable {
}
Map<Variable, Generic> content(@Nonnull Function<Variable, Generic> c) {
final Map<Variable, Generic> result = new HashMap<>(size);
final Map<Variable, Generic> result = new TreeMap<>();
for (int i = 0; i < size; i++) {
result.put(variables[i], c.apply(variables[i]));