diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-09-18 12:12:14 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-09-18 12:12:14 +0200 |
commit | 44f08a00c6537929bcf8a812b4ec4fb046e8ed1c (patch) | |
tree | a571692c0ca9f01d2e9b99ff2973996b41ba3ac2 | |
parent | 55128db0ac7bda5ebe0241a4577b0aea40eddc50 (diff) |
Use a ternary to visualize that we always return something valid.
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcInvokerFactory.java | 8 |
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 |