Github user ifesdjeen commented on a diff in the pull request:
https://github.com/apache/cassandra/pull/271#discussion_r220868472
--- Diff: src/java/org/apache/cassandra/locator/EndpointsByRange.java ---
@@ -54,9 +55,13 @@ public void putAll(Range<Token> range, EndpointsForRange
replicas, Conflict igno
get(range).addAll(replicas, ignoreConflicts);
}
- public EndpointsByRange asImmutableView()
+ public EndpointsByRange build()
{
- return new
EndpointsByRange(Collections.unmodifiableMap(Maps.transformValues(map,
EndpointsForRange.Mutable::asImmutableView)));
+ Map<Range<Token>, EndpointsForRange> map =
+ Collections.unmodifiableMap(
+ new HashMap<>(
--- End diff --
Is it really cheaper than, say `ImmutableMap.copyOf()`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]