mapleFU commented on code in PR #2277:
URL: https://github.com/apache/kvrocks/pull/2277#discussion_r1582488599
##########
src/storage/rdb.cc:
##########
@@ -1005,3 +1000,35 @@ Status RDB::rdbSaveBinaryDoubleValue(double val) {
memrev64ifbe(&val);
return stream_->Write((const char *)(&val), sizeof(val));
}
+
+Status RDB::rdbSaveZipListObject(const std::string &elem) {
+ // calc total ziplist size
+ uint prevlen = 0;
+ const size_t ziplist_size = zlHeaderSize + zlEndSize + elem.length() +
+ ZipList::ZipStorePrevEntryLength(nullptr,
prevlen) +
+ ZipList::ZipStoreEntryEncoding(nullptr,
elem.length());
+ auto zl_string = std::string(ziplist_size, 0);
Review Comment:
Why the size would be 0? Isn't it same as `ziplist_size`?
--
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]