Skip to content

Commit

Permalink
*: use UniqueIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed Jul 5, 2022
1 parent 5506461 commit e69b4bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/kvrocks2redis/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "../../src/redis_slot.h"
#include "../../src/redis_reply.h"
#include "db_util.h"

Status Parser::ParseFullDB() {
rocksdb::DB *db_ = storage_->GetDB();
Expand Down Expand Up @@ -89,7 +90,7 @@ Status Parser::parseComplexKV(const Slice &ns_key, const Metadata &metadata) {
read_options.iterate_upper_bound = &upper_bound;
read_options.fill_cache = false;

auto iter = std::unique_ptr<rocksdb::Iterator>(db_->NewIterator(read_options));
auto iter = DBUtil::UniqueIterator(db_, read_options);
for (iter->Seek(prefix_key); iter->Valid(); iter->Next()) {
if (!iter->key().starts_with(prefix_key)) {
break;
Expand Down

0 comments on commit e69b4bd

Please # to comment.