apoorvmittal10 commented on code in PR #16535:
URL: https://github.com/apache/kafka/pull/16535#discussion_r1904129203
##########
core/src/main/java/kafka/server/share/SharePartition.java:
##########
@@ -1421,9 +1421,7 @@ be removed once all the messages (0-99) are acknowledged
(ACCEPT or REJECT).
if (lastKeyToRemove != -1) {
NavigableMap<Long, InFlightBatch> subMap =
cachedState.subMap(firstKeyToRemove, true, lastKeyToRemove, true);
- for (Long key : subMap.keySet()) {
- cachedState.remove(key);
- }
+ subMap.clear();
Review Comment:
nit: the change could be inline:
```
cachedState.subMap(firstKeyToRemove, true, lastKeyToRemove, true).clear()
--
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]