diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-11-29 09:47:20 -0800 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-11-29 09:47:20 -0800 |
commit | 1dbf502e896400f3cbcdf0d66b32cedb935d81b2 (patch) | |
tree | e5ebda4582cff30d93f33d7035ad36fd840ebaac /vespajlib | |
parent | 0ac6c004fec12b4350b86f7b28f410a66ed81484 (diff) |
Make type comparison order independent
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/tensor/TensorType.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java index 4ad0835cfb4..48b2824deae 100644 --- a/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java +++ b/vespajlib/src/main/java/com/yahoo/tensor/TensorType.java @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -83,7 +84,7 @@ public class TensorType { public boolean equals(Object other) { if (this == other) return true; if (other == null || getClass() != other.getClass()) return false; - return dimensions.equals(((TensorType)other).dimensions); + return new HashSet<>(dimensions).equals(new HashSet<>(((TensorType)other).dimensions)); } @Override |