kenhuuu commented on code in PR #2614:
URL: https://github.com/apache/tinkerpop/pull/2614#discussion_r1609211829
##########
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/ConnectionPool.java:
##########
@@ -663,18 +664,19 @@ public String getPoolInfo(final Connection
connectionToCallout) {
private void appendConnections(final StringBuilder sb, final Connection
connectionToCallout,
final List<Connection> connections) {
- final int connectionCount = connections.size();
- for (int ix = 0; ix < connectionCount; ix++) {
- final Connection c = connections.get(ix);
- if (c.equals(connectionToCallout))
+ final Iterator<Connection> it = connections.iterator();
Review Comment:
Minor nit: There aren't any tests for this PR, but this might be ok since
appendConnections is only used for logging. But seeing as how we are now
dependent on the CopyOnWriteArrayList's iterator behavior, we might want to add
a small comment and maybe even explicitly declare connections as a
CopyOnWriteArrayList<Connection> rather than just a List<Connection>.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]