leventov commented on a change in pull request #7595: Optimize overshadowed
segments computation
URL: https://github.com/apache/incubator-druid/pull/7595#discussion_r291276853
##########
File path: core/src/main/java/org/apache/druid/utils/CollectionUtils.java
##########
@@ -68,6 +71,17 @@ public int size()
};
}
+ /**
+ * Returns a transformed map from the given input map where the value is
modified based on the given valueMapper
+ * function.
+ */
+ public static <K, V, V2> Map<K, V2> transformValues(Map<K, V> map,
Function<V, V2> valueMapper)
+ {
+ final Map<K, V2> result = new HashMap<>();
Review comment:
Better to use `Maps.newHashMapWithExpectedSize(map.size())` here
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]