richardstartin commented on a change in pull request #7777:
URL: https://github.com/apache/pinot/pull/7777#discussion_r751781564



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
##########
@@ -612,7 +656,8 @@ public void processMultiValue(int numDocs, int[][] 
outGroupIds) {
     private int getGroupId(long rawKey) {
       int numGroups = _groupIdMap.size();
       if (numGroups < _globalGroupIdUpperBound) {
-        return _groupIdMap.computeIfAbsent(rawKey, k -> numGroups);
+        int id = _groupIdMap.putIfAbsent(rawKey, numGroups);
+        return id == _groupIdMap.defaultReturnValue() ? numGroups : id;

Review comment:
       Maybe, the intent here was just to remove the capturing lambda while I 
was looking at something nearby. There’s no justification for this change, 
except to eliminate an allocation.




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to