Skip to content

Commit 33e93db

Browse files
committed
Move comments from caller to function declaration
1 parent a72cada commit 33e93db

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/storage/redis_db.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,6 @@ rocksdb::Status Database::MDel(engine::Context &ctx, const std::vector<Slice> &k
191191
if (statuses[i].IsNotFound()) continue;
192192

193193
Metadata metadata(kRedisNone, false);
194-
// Explicit construct a rocksdb::Slice to avoid the implicit conversion from
195-
// PinnableSlice to Slice.
196194
auto s = metadata.Decode(rocksdb::Slice(pin_values[i].data(), pin_values[i].size()));
197195
if (!s.ok()) continue;
198196
if (metadata.Expired()) continue;
@@ -233,8 +231,6 @@ rocksdb::Status Database::Exists(engine::Context &ctx, const std::vector<Slice>
233231
if (!statuses[i].ok() && !statuses[i].IsNotFound()) return statuses[i];
234232
if (statuses[i].ok()) {
235233
Metadata metadata(kRedisNone, false);
236-
// Explicit construct a rocksdb::Slice to avoid the implicit conversion from
237-
// PinnableSlice to Slice.
238234
auto s = metadata.Decode(rocksdb::Slice(pin_values[i].data(), pin_values[i].size()));
239235
if (!s.ok()) return s;
240236
if (!metadata.Expired()) *ret += 1;

src/storage/redis_metadata.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ class Metadata {
199199
bool IsEmptyableType() const;
200200

201201
virtual void Encode(std::string *dst) const;
202+
203+
// Calls remove_prefix() internally and would modify the original `input` state.
202204
[[nodiscard]] virtual rocksdb::Status Decode(Slice *input);
205+
203206
[[nodiscard]] rocksdb::Status Decode(Slice input);
204207

205208
bool operator==(const Metadata &that) const;

0 commit comments

Comments
 (0)