Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version typo in variable name #1591

Merged
merged 3 commits into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/types/redis_zset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,16 @@ rocksdb::Status ZSet::RangeByRank(const Slice &user_key, const RangeRankSpec &sp
std::string score_bytes;
double score = !(spec.reversed) ? kMinScore : kMaxScore;
PutDouble(&score_bytes, score);
std::string start_key, prefix_key, next_verison_prefix_key;
std::string start_key, prefix_key, next_version_prefix_key;
InternalKey(ns_key, score_bytes, metadata.version, storage_->IsSlotIdEncoded()).Encode(&start_key);
InternalKey(ns_key, "", metadata.version, storage_->IsSlotIdEncoded()).Encode(&prefix_key);
InternalKey(ns_key, "", metadata.version + 1, storage_->IsSlotIdEncoded()).Encode(&next_verison_prefix_key);
InternalKey(ns_key, "", metadata.version + 1, storage_->IsSlotIdEncoded()).Encode(&next_version_prefix_key);

int removed_subkey = 0;
rocksdb::ReadOptions read_options = storage_->DefaultScanOptions();
LatestSnapShot ss(storage_);
read_options.snapshot = ss.GetSnapShot();
rocksdb::Slice upper_bound(next_verison_prefix_key);
rocksdb::Slice upper_bound(next_version_prefix_key);
read_options.iterate_upper_bound = &upper_bound;
rocksdb::Slice lower_bound(prefix_key);
read_options.iterate_lower_bound = &lower_bound;
Expand Down Expand Up @@ -584,15 +584,15 @@ rocksdb::Status ZSet::Rank(const Slice &user_key, const Slice &member, bool reve
if (!s.ok()) return s.IsNotFound() ? rocksdb::Status::OK() : s;

double target_score = DecodeDouble(score_bytes.data());
std::string start_score_bytes, start_key, prefix_key, next_verison_prefix_key;
std::string start_score_bytes, start_key, prefix_key, next_version_prefix_key;
double start_score = !reversed ? kMinScore : kMaxScore;
PutDouble(&start_score_bytes, start_score);
InternalKey(ns_key, start_score_bytes, metadata.version, storage_->IsSlotIdEncoded()).Encode(&start_key);
InternalKey(ns_key, "", metadata.version, storage_->IsSlotIdEncoded()).Encode(&prefix_key);
InternalKey(ns_key, "", metadata.version + 1, storage_->IsSlotIdEncoded()).Encode(&next_verison_prefix_key);
InternalKey(ns_key, "", metadata.version + 1, storage_->IsSlotIdEncoded()).Encode(&next_version_prefix_key);

int rank = 0;
rocksdb::Slice upper_bound(next_verison_prefix_key);
rocksdb::Slice upper_bound(next_version_prefix_key);
read_options.iterate_upper_bound = &upper_bound;
rocksdb::Slice lower_bound(prefix_key);
read_options.iterate_lower_bound = &lower_bound;
Expand Down