git-hulk commented on PR #2217:
URL: https://github.com/apache/kvrocks/pull/2217#issuecomment-2034062326

   > @git-hulk I pre-allocated the namespaces variable, I don't know if it's 
alright. Any idea why clang-tidy doesn't raise the same error for the command 
`namespace get *` implementation? My PR is based on this: 
https://github.com/apache/kvrocks/blob/unstable/src/commands/cmd_server.cc#L100-L107
   > 
   > ```c++
   >   std::vector<std::string> namespaces;
   >   auto tokens = srv->GetNamespace()->List();
   >   for (auto &token : tokens) {
   >     namespaces.emplace_back(token.second);  // namespace
   >     namespaces.emplace_back(token.first);   // token
   >   }
   >   namespaces.emplace_back(kDefaultNamespace);
   >   namespaces.emplace_back(config->requirepass);
   > ```
   
   @kinoute That's right to reverse the space for namespaces. And why it 
doesn't raise an error in the previous codes, is because it's added before 
introducing the linter.


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

Reply via email to