Skip to content

Commit

Permalink
Merge pull request XRPLF#274 from wankai/master
Browse files Browse the repository at this point in the history
typo improvement
  • Loading branch information
igorcanadi committed Sep 6, 2014
2 parents 40ddc3d + 4c2b1f0 commit b7b031f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions table/plain_table_key_coding.cc
Expand Up @@ -97,9 +97,9 @@ Status PlainTableKeyEncoder::AppendKey(const Slice& key, WritableFile* file,

Slice prefix =
prefix_extractor_->Transform(Slice(key.data(), user_key_size));
if (key_count_for_prefix == 0 || prefix != pre_prefix_.GetKey() ||
key_count_for_prefix % index_sparseness_ == 0) {
key_count_for_prefix = 1;
if (key_count_for_prefix_ == 0 || prefix != pre_prefix_.GetKey() ||
key_count_for_prefix_ % index_sparseness_ == 0) {
key_count_for_prefix_ = 1;
pre_prefix_.SetKey(prefix);
size_bytes_pos += EncodeSize(kFullKey, user_key_size, size_bytes);
Status s = file->Append(Slice(size_bytes, size_bytes_pos));
Expand All @@ -108,8 +108,8 @@ Status PlainTableKeyEncoder::AppendKey(const Slice& key, WritableFile* file,
}
*offset += size_bytes_pos;
} else {
key_count_for_prefix++;
if (key_count_for_prefix == 2) {
key_count_for_prefix_++;
if (key_count_for_prefix_ == 2) {
// For second key within a prefix, need to encode prefix length
size_bytes_pos +=
EncodeSize(kPrefixFromPreviousKey, pre_prefix_.GetKey().size(),
Expand Down
4 changes: 2 additions & 2 deletions table/plain_table_key_coding.h
Expand Up @@ -26,7 +26,7 @@ class PlainTableKeyEncoder {
fixed_user_key_len_(user_key_len),
prefix_extractor_(prefix_extractor),
index_sparseness_((index_sparseness > 1) ? index_sparseness : 1),
key_count_for_prefix(0) {}
key_count_for_prefix_(0) {}
// key: the key to write out, in the format of internal key.
// file: the output file to write out
// offset: offset in the file. Needs to be updated after appending bytes
Expand All @@ -45,7 +45,7 @@ class PlainTableKeyEncoder {
uint32_t fixed_user_key_len_;
const SliceTransform* prefix_extractor_;
const size_t index_sparseness_;
size_t key_count_for_prefix;
size_t key_count_for_prefix_;
IterKey pre_prefix_;
};

Expand Down

0 comments on commit b7b031f

Please sign in to comment.