diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2021-01-10 12:23:57 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2021-01-10 12:23:57 +0100 |
commit | a0a55270b4b370238ee949eef62c9c69e82fd76b (patch) | |
tree | ce5fe04ee748eb4ea9812523fa87d0e5d53a629e /container-search/src/main/java/com/yahoo/search/query/profile/PrefixQueryProfileVisitor.java | |
parent | a8fcb9a0eadd03887fb8efd1602c00e71ed9b261 (diff) |
Clean up
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/PrefixQueryProfileVisitor.java')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/query/profile/PrefixQueryProfileVisitor.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/PrefixQueryProfileVisitor.java b/container-search/src/main/java/com/yahoo/search/query/profile/PrefixQueryProfileVisitor.java index 6077e6ae7e0..b53fc4f96f2 100644 --- a/container-search/src/main/java/com/yahoo/search/query/profile/PrefixQueryProfileVisitor.java +++ b/container-search/src/main/java/com/yahoo/search/query/profile/PrefixQueryProfileVisitor.java @@ -15,7 +15,7 @@ import java.util.Map; */ abstract class PrefixQueryProfileVisitor extends QueryProfileVisitor { - protected final Map<CompoundName, Map<String, CompoundName>> cache; + protected final CompoundNameChildCache cache; /** Only call onValue/onQueryProfile for nodes having this prefix */ private final CompoundName prefix; @@ -26,7 +26,7 @@ abstract class PrefixQueryProfileVisitor extends QueryProfileVisitor { private int prefixComponentIndex = -1; - public PrefixQueryProfileVisitor(CompoundName prefix, Map<CompoundName, Map<String, CompoundName>> cache) { + public PrefixQueryProfileVisitor(CompoundName prefix, CompoundNameChildCache cache) { if (prefix == null) prefix = CompoundName.empty; this.prefix = prefix; @@ -52,7 +52,7 @@ abstract class PrefixQueryProfileVisitor extends QueryProfileVisitor { if (prefixComponentIndex++ < prefix.size()) return true; // we're in the given prefix, which should not be included in the name if ( ! name.isEmpty()) { currentPrefixes.push(currentPrefix); - currentPrefix = cache.computeIfAbsent(currentPrefix, __ -> new HashMap<>()).computeIfAbsent(name, currentPrefix::append); + currentPrefix = cache.append(currentPrefix, name); } return true; } |