summaryrefslogtreecommitdiffstats
path: root/container-search
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-09-18 12:12:14 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2019-09-18 12:12:14 +0200
commit44f08a00c6537929bcf8a812b4ec4fb046e8ed1c (patch)
treea571692c0ca9f01d2e9b99ff2973996b41ba3ac2 /container-search
parent55128db0ac7bda5ebe0241a4577b0aea40eddc50 (diff)
Use a ternary to visualize that we always return something valid.
Diffstat (limited to 'container-search')
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java
index 85f890e03ce..54c61881c47 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java
@@ -47,11 +47,9 @@ public class RpcInvokerFactory extends InvokerFactory implements PingFactory {
boolean summaryNeedsQuery = searcher.summaryNeedsQuery(query);
boolean useProtoBuf = query.properties().getBoolean(Dispatcher.dispatchProtobuf, dispatchWithProtobuf);
- if ((query.properties().getBoolean(dispatchSummaries, true) || !useProtoBuf) && ! summaryNeedsQuery) {
- return Optional.of(new RpcFillInvoker(rpcResourcePool, searcher.getDocumentDatabase(query)));
- } else {
- return Optional.of(new RpcProtobufFillInvoker(rpcResourcePool, searcher.getDocumentDatabase(query), searcher.getServerId(), summaryNeedsQuery));
- }
+ return ((query.properties().getBoolean(dispatchSummaries, true) || !useProtoBuf) && ! summaryNeedsQuery)
+ ? Optional.of(new RpcFillInvoker(rpcResourcePool, searcher.getDocumentDatabase(query)))
+ : Optional.of(new RpcProtobufFillInvoker(rpcResourcePool, searcher.getDocumentDatabase(query), searcher.getServerId(), summaryNeedsQuery));
}
// for testing