diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-02-02 21:50:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 21:50:59 +0100 |
commit | 19b00b8a3506a1158d9807238f2f3c0168e56a86 (patch) | |
tree | 737ff01dd86dc1844afcd6de59c02071cd8ca40c /config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java | |
parent | 7b56c57270e651bb7ad0dbe0a3a761c656b919f1 (diff) |
Revert "Use LinkedHashMap to get deterministic config order"
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java index 495f5473442..5b842b002bd 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/RankProfile.java @@ -32,7 +32,7 @@ import java.io.Serializable; import java.io.StringReader; import java.util.ArrayList; import java.util.Collections; -import java.util.LinkedHashMap; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; @@ -121,7 +121,7 @@ public class RankProfile implements Cloneable { private final RankProfileRegistry rankProfileRegistry; /** Constants in ranking expressions */ - private Map<String, Value> constants = new LinkedHashMap<>(); + private Map<String, Value> constants = new HashMap<>(); private final TypeSettings attributeTypes = new TypeSettings(); @@ -396,9 +396,9 @@ public class RankProfile implements Cloneable { /** Returns an unmodifiable view of the constants available in this */ public Map<String, Value> getConstants() { - if (inherited().isEmpty()) return new LinkedHashMap<>(constants); + if (inherited().isEmpty()) return new HashMap<>(constants); - Map<String, Value> allConstants = new LinkedHashMap<>(); + Map<String, Value> allConstants = new HashMap<>(); for (var inheritedProfile : inherited()) { for (var constant : inheritedProfile.getConstants().entrySet()) { if (allConstants.containsKey(constant.getKey())) @@ -873,7 +873,7 @@ public class RankProfile implements Cloneable { clone.functions = new LinkedHashMap<>(this.functions); clone.allFunctionsCached = null; clone.filterFields = new HashSet<>(this.filterFields); - clone.constants = new LinkedHashMap<>(this.constants); + clone.constants = new HashMap<>(this.constants); return clone; } catch (CloneNotSupportedException e) { @@ -989,7 +989,7 @@ public class RankProfile implements Cloneable { public MapEvaluationTypeContext typeContext() { return typeContext(new QueryProfileRegistry()); } private Map<Reference, TensorType> collectFeatureTypes() { - Map<Reference, TensorType> featureTypes = new LinkedHashMap<>(); + Map<Reference, TensorType> featureTypes = new HashMap<>(); // Add input features inputFeatures.forEach((k, v) -> featureTypes.put(k, v)); // Add attributes @@ -1042,7 +1042,7 @@ public class RankProfile implements Cloneable { } private Map<String, TensorType> resolveOnnxInputTypes(OnnxModel model, MapEvaluationTypeContext context) { - Map<String, TensorType> inputTypes = new LinkedHashMap<>(); + Map<String, TensorType> inputTypes = new HashMap<>(); for (String onnxInputName : model.getInputMap().keySet()) { resolveOnnxInputType(onnxInputName, model, context).ifPresent(type -> inputTypes.put(onnxInputName, type)); } @@ -1320,7 +1320,7 @@ public class RankProfile implements Cloneable { public static class TypeSettings { - private final Map<String, String> types = new LinkedHashMap<>(); + private final Map<String, String> types = new HashMap<>(); void addType(String name, String type) { types.put(name, type); |