This is an automated email from the ASF dual-hosted git repository.
twice 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 bf854507 Avoid the implicit conversion from PinnableSlice to Slice
(#2039)
bf854507 is described below
commit bf85450774982606be3233288ac82f0a9cc62e21
Author: mwish <[email protected]>
AuthorDate: Mon Jan 22 22:16:31 2024 +0800
Avoid the implicit conversion from PinnableSlice to Slice (#2039)
---
src/storage/redis_db.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/storage/redis_db.cc b/src/storage/redis_db.cc
index eaa94b43..a9751bbf 100644
--- a/src/storage/redis_db.cc
+++ b/src/storage/redis_db.cc
@@ -185,7 +185,9 @@ rocksdb::Status Database::MDel(const std::vector<Slice>
&keys, uint64_t *deleted
if (statuses[i].IsNotFound()) continue;
Metadata metadata(kRedisNone, false);
- auto s = metadata.Decode(pin_values[i]);
+ // Explicit construct a rocksdb::Slice to avoid the implicit conversion
from
+ // PinnableSlice to Slice.
+ auto s = metadata.Decode(rocksdb::Slice(pin_values[i].data(),
pin_values[i].size()));
if (!s.ok()) continue;
if (metadata.Expired()) continue;