git-hulk commented on code in PR #2225:
URL: https://github.com/apache/kvrocks/pull/2225#discussion_r1554760246


##########
src/storage/redis_db.h:
##########
@@ -82,10 +82,10 @@ class Database {
   [[nodiscard]] rocksdb::Status Expire(const Slice &user_key, uint64_t 
timestamp);
   [[nodiscard]] rocksdb::Status Del(const Slice &user_key);
   [[nodiscard]] rocksdb::Status MDel(const std::vector<Slice> &keys, uint64_t 
*deleted_cnt);
-  [[nodiscard]] rocksdb::Status Exists(const std::vector<Slice> &keys, int 
*ret);
+  [[nodiscard]] rocksdb::Status Exists(const std::vector<Slice> &keys, int 
*ret, bool internal_key = false);

Review Comment:
   How about keeping the old method signature and adding a new private method 
like:
   
   ```
    rocksdb::Status Exists(const std::vector<Slice> &keys, int *ret) {
      ns_keys.reserve(keys.size());
      for (const auto &user_key : keys) {
        ns_keys.emplace_back(AppendNamespacePrefix(key));
      }
      return exits(ns_keys, ret);
    }
    
    // private method
    rocksdb::Status exists(const std::vector<Slice> &ns_keys, int *ret) {
    }
   ```
   So it should be more intuitive since we don't need to check if it's an 
internal inside `exitst` method. What do you think?



-- 
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