jamesge commented on a change in pull request #972: Redis server protocol
URL: https://github.com/apache/incubator-brpc/pull/972#discussion_r358047288
##########
File path: src/brpc/redis.cpp
##########
@@ -435,5 +435,31 @@ std::ostream& operator<<(std::ostream& os, const
RedisResponse& response) {
}
return os;
}
+
+bool RedisService::AddCommandHandler(const std::string& name,
RedisCommandHandler* handler) {
+ std::string lcname;
+ lcname.resize(name.size());
+ std::transform(name.begin(), name.end(), lcname.begin(),
+ [](unsigned char c){ return std::tolower(c); });
+ if (_command_map.count(lcname)) {
Review comment:
建议和下面相关的实现保持一致,要么都是count,要么都是find和end比较。建议用后者。
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]