mapleFU commented on code in PR #1798:
URL: https://github.com/apache/kvrocks/pull/1798#discussion_r1365600862


##########
src/storage/rdb.cc:
##########
@@ -156,10 +173,9 @@ StatusOr<std::string> RDB::loadEncodedString() {
   }
 
   // Normal string
-  GET_OR_RET(peekOk(static_cast<size_t>(len)));
-  auto value = std::string(input_.data() + pos_, len);
-  pos_ += len;
-  return value;
+  std::vector<char> vec(len);
+  GET_OR_RET(stream_->Read(vec.data(), len));

Review Comment:
   Could it be `len == 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to