jamesge commented on a change in pull request #972: Redis server protocol
URL: https://github.com/apache/incubator-brpc/pull/972#discussion_r358590004
##########
File path: src/brpc/redis_reply.h
##########
@@ -160,6 +213,46 @@ inline int64_t RedisReply::integer() const {
return 0;
}
+inline bool RedisReply::SetNullArray() {
+ if (_type != REDIS_REPLY_NIL) {
+ return false;
Review comment:
我觉得大部分用户都不可能去检查SetXXX的返回值,这就相当于静默失败,并触发后续设置时一系列失败。这里的核心问题是是否可能出现需要多次Set的场景?比如在开始设为一个默认类型,之后在不同的分支中修改。更实际的实现是增加Reset()接口,并在return
false的分支中调用。析构函数中也可以考虑复用。
----------------------------------------------------------------
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]