mapleFU commented on code in PR #1710:
URL: https://github.com/apache/kvrocks/pull/1710#discussion_r1309715631


##########
src/types/redis_bloom_chain.cc:
##########
@@ -143,21 +143,21 @@ rocksdb::Status BloomChain::Add(const Slice &user_key, 
const Slice &item, int *r
   WriteBatchLogData log_data(kRedisBloomFilter, {"insert"});
   batch->PutLogData(log_data.Encode());
 
-  int check_index = metadata.n_filters - 1;
   std::string item_string = item.ToString();
 
   // check
-  for (; check_index >= 0; --check_index) {  // TODO: to test which direction 
for searching is better
-    s = bloomCheck(bf_key_list[check_index], item_string, ret);
+  int check_ret = 0;
+  for (int i = metadata.n_filters - 1; i >= 0; --i) {  // TODO: to test which 
direction for searching is better
+    s = bloomCheck(bf_key_list[i], item_string, &check_ret);

Review Comment:
   Actually I think a `Result<bool>` might be better here. Since "int" might be 
weird ( RedisBloom using C language, C Boolean is just a hacking )



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