Skip to content

Commit

Permalink
Make code much easier to read without misleading variable name and ne…
Browse files Browse the repository at this point in the history
…gation.

RELNOTES: None
PiperOrigin-RevId: 191709934
  • Loading branch information
meisterT authored and Copybara-Service committed Apr 5, 2018
1 parent b7d65cd commit 8abed4b
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,21 @@ public static void output(QueryOptions queryOptions, QueryEvalResult result,
* output everything in one batch. This happens when the QueryEnvironment does not
* support streaming but we don't care about ordered results.
*/
boolean orderedResults = !shouldStreamResults(queryOptions, formatter);
if (orderedResults) {
formatter.output(queryOptions,
((DigraphQueryEvalResult<Target>) result).getGraph().extractSubgraph(targetsResult),
outputStream, aspectResolver);
} else {
if (shouldStreamResults(queryOptions, formatter)) {
StreamedFormatter streamedFormatter = (StreamedFormatter) formatter;
streamedFormatter.setOptions(queryOptions, aspectResolver);
OutputFormatterCallback.processAllTargets(
streamedFormatter.createPostFactoStreamCallback(outputStream, queryOptions),
targetsResult);
} else {
@SuppressWarnings("unchecked")
DigraphQueryEvalResult<Target> digraphQueryEvalResult =
(DigraphQueryEvalResult<Target>) result;
formatter.output(
queryOptions,
digraphQueryEvalResult.getGraph().extractSubgraph(targetsResult),
outputStream,
aspectResolver);
}
}
}

0 comments on commit 8abed4b

Please sign in to comment.