Github user aweisberg commented on a diff in the pull request:
https://github.com/apache/cassandra/pull/283#discussion_r225334814
--- Diff: src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
---
@@ -210,8 +368,10 @@ public String getDatacenter(InetAddressAndPort
endpoint)
// TODO: avoid copy
replicas = subsnitch.sortedByProximity(address, replicas);
- HashMap<InetAddressAndPort, Double> scores = this.scores; // Make
sure the score don't change in the middle of the loop below
- // (which
wouldn't really matter here but its cleaner that way).
+ // Make sure the score don't change in the middle of the loop below
+ // (which wouldn't really matter here but its cleaner that way).
+ final Map<InetAddressAndPort, Double> scores = this.scores;
--- End diff --
I don't think we generally do final on the stack or for parameters to
functions. I can't find anything in the style guide that says you can't do it,
but I recall being told that at one point. I'll ask around.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]