This is an automated email from the ASF dual-hosted git repository.

maplefu pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git


The following commit(s) were added to refs/heads/unstable by this push:
     new 3e995df5 RDB: fix Endian handling in rdb_intset (#1830)
3e995df5 is described below

commit 3e995df5ed7b369c8cbf63f86cce5f9bda65a56d
Author: mwish <[email protected]>
AuthorDate: Mon Oct 16 17:35:15 2023 +0800

    RDB: fix Endian handling in rdb_intset (#1830)
---
 src/storage/rdb_intset.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/storage/rdb_intset.cc b/src/storage/rdb_intset.cc
index 58431f65..328e7a0d 100644
--- a/src/storage/rdb_intset.cc
+++ b/src/storage/rdb_intset.cc
@@ -40,10 +40,10 @@ StatusOr<std::vector<std::string>> IntSet::Entries() {
   uint32_t encoding = 0, len = 0;
   memcpy(&encoding, input_.data() + pos_, sizeof(uint32_t));
   pos_ += sizeof(uint32_t);
-  intrev32ifbe(&encoding);
+  memrev32ifbe(&encoding);
   memcpy(&len, input_.data() + pos_, sizeof(uint32_t));
   pos_ += sizeof(uint32_t);
-  intrev32ifbe(&len);
+  memrev32ifbe(&len);
 
   uint32_t record_size = encoding;
   if (record_size == 0) {
@@ -60,7 +60,7 @@ StatusOr<std::vector<std::string>> IntSet::Entries() {
         uint16_t v = 0;
         memcpy(&v, input_.data() + pos_, sizeof(uint16_t));
         pos_ += sizeof(uint16_t);
-        intrev16ifbe(&v);
+        memrev16ifbe(&v);
         entries.emplace_back(std::to_string(v));
         break;
       }
@@ -68,7 +68,7 @@ StatusOr<std::vector<std::string>> IntSet::Entries() {
         uint32_t v = 0;
         memcpy(&v, input_.data() + pos_, sizeof(uint32_t));
         pos_ += sizeof(uint32_t);
-        intrev32ifbe(&v);
+        memrev32ifbe(&v);
         entries.emplace_back(std::to_string(v));
         break;
       }
@@ -76,7 +76,7 @@ StatusOr<std::vector<std::string>> IntSet::Entries() {
         uint64_t v = 0;
         memcpy(&v, input_.data() + pos_, sizeof(uint64_t));
         pos_ += sizeof(uint64_t);
-        intrev64ifbe(&v);
+        memrev64ifbe(&v);
         entries.emplace_back(std::to_string(v));
         break;
       }

Reply via email to