zt52875287 opened a new pull request, #19442:
URL: https://github.com/apache/kafka/pull/19442

   This patch simplifies the implementation of PartitionStates#update by 
removing the unnecessary grouping of TopicPartitions by topic. The original 
logic constructed an intermediate map by topic name, but ultimately only 
inserted each (TopicPartition, state) pair into the internal LinkedHashMap. 
This grouping had no effect on the final result.
   
   The updated implementation directly iterates over the input map, improving 
clarity and reducing overhead.
   
   Additionally, the unit test has been updated to remove reliance on a 
specific iteration order of partition states. Since both PartitionStates#set 
and its internal update method accept a Map as input, and standard Java Maps do 
not guarantee any ordering beyond insertion order (which may not be preserved 
across implementations), tests should not assume a fixed output order unless 
explicitly defined by the API.
   


-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to