You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/11/23 02:16:56 UTC

[GitHub] [incubator-brpc] 372046933 commented on a diff in pull request #2009: Early return when size == 0

372046933 commented on code in PR #2009:
URL: https://github.com/apache/incubator-brpc/pull/2009#discussion_r1029969953


##########
src/butil/iobuf.cpp:
##########
@@ -1211,6 +1211,9 @@ int IOBuf::append_user_data(void* data, size_t size, void (*deleter)(void*)) {
         LOG(FATAL) << "data_size=" << size << " is too large";
         return -1;
     }
+    if (!size) {
+        return 0;

Review Comment:
   Was deleter called in the original implementation when size is 0?



-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org