lynnbond commented on code in PR #2143: URL: https://github.com/apache/incubator-hugegraph/pull/2143#discussion_r1128889643
########## hugegraph-api/src/main/java/org/apache/hugegraph/api/cypher/CypherClient.java: ########## @@ -81,21 +87,19 @@ public CypherModel submitQuery(String cypherQuery,@Nullable Map<String, String> private RequestMessage createRequest(String cypherQuery) { return RequestMessage.build(Tokens.OPS_EVAL) - .processor("cypher") - .add(Tokens.ARGS_GREMLIN, cypherQuery) - .create(); + .processor("cypher") + .add(Tokens.ARGS_GREMLIN, cypherQuery) + .create(); } private List<Object> doQueryList(Client client, RequestMessage request) - throws ExecutionException, InterruptedException { - - ResultSet results = null; - results = client.submitAsync(request).get(); + throws ExecutionException, InterruptedException { + ResultSet results = client.submitAsync(request).get(); Iterator<Result> iter = results.iterator(); List<Object> list = new LinkedList<>(); - for (; iter.hasNext(); ) { + while (iter.hasNext()) { Review Comment: It's better to use a LinkedList in two conditions which are itemized below: 1. The amount of items is unknown. 2. There is no need to access items by index. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@hugegraph.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org