You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "gloof11 (via GitHub)" <gi...@apache.org> on 2023/06/17 01:12:00 UTC

[GitHub] [incubator-kvrocks] gloof11 commented on a diff in pull request #1498: Warning message for invalid key in configuration file

gloof11 commented on code in PR #1498:
URL: https://github.com/apache/incubator-kvrocks/pull/1498#discussion_r1232920527


##########
src/config/config.cc:
##########
@@ -659,6 +659,12 @@ Status Config::parseConfigFromPair(const std::pair<std::string, std::string> &in
     tokens[input.second] = input.first.substr(ns_str_size);
   }
   auto iter = fields_.find(field_key);
+
+  // Check if a configuration key is a valid key
+  if (iter->second == 0x0) {

Review Comment:
   I realized that "iter" after the find operations returns an object of all possible keys. I summarized that "iter->second" points to the name of the key, so if you were to pass a key that cannot exist, it would return zero. Therefore, if it finds a key that doesn't exist, it will return 0x0.



-- 
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: issues-unsubscribe@kvrocks.apache.org

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