showuon commented on a change in pull request #11691:
URL: https://github.com/apache/kafka/pull/11691#discussion_r787408812



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
##########
@@ -194,8 +194,8 @@
     public static Map<String, Object> 
postProcessReconnectBackoffConfigs(AbstractConfig config,
                                                     Map<String, Object> 
parsedValues) {
         HashMap<String, Object> rval = new HashMap<>();
-        if ((!config.originals().containsKey(RECONNECT_BACKOFF_MAX_MS_CONFIG)) 
&&
-                config.originals().containsKey(RECONNECT_BACKOFF_MS_CONFIG)) {
+        if ((!config.hasKeyInOriginals(RECONNECT_BACKOFF_MAX_MS_CONFIG)) &&
+                config.hasKeyInOriginals(RECONNECT_BACKOFF_MS_CONFIG)) {

Review comment:
       4. refactor the `originals().containsKey` usage. In `originals()`, we'll 
make a copy of the configs, and in most cases, we only want to check 
`containsKey`. Refactor it by directly check the key in `AbstractConfigs` to 
avoid unnecessary map copy.




-- 
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