PragmaTwice commented on code in PR #2627:
URL: https://github.com/apache/kvrocks/pull/2627#discussion_r1820033411


##########
src/server/redis_reply.cc:
##########
@@ -37,9 +37,23 @@ namespace redis {
 
 void Reply(evbuffer *output, const std::string &data) { evbuffer_add(output, 
data.c_str(), data.length()); }
 
-std::string SimpleString(const std::string &data) { return "+" + data + CRLF; }
+std::string SimpleString(const std::string &data) { 

Review Comment:
   For some cases (e.g. we need to pass a null-terminated string to a C api), 
`std::string` is required since `std::string_view` will not ensure that the 
string is terminated by `\0`.
   In other cases, it can be replaced by std::string_view if the lifetime can 
be maintained well (no dangling happen).



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