Browse Source

simplify SetOtherInputs

light_ver
ArcueidType 2 weeks ago
parent
commit
47e4063400
2 changed files with 5 additions and 5 deletions
  1. +4
    -4
      db/version_set.cc
  2. +1
    -1
      db/version_set.h

+ 4
- 4
db/version_set.cc View File

@ -1298,7 +1298,7 @@ Compaction* VersionSet::PickCompaction() {
assert(!c->inputs_[0].empty());
}
SetupOtherInputs(c, false);
SetupOtherInputs(c);
return c;
}
@ -1382,7 +1382,7 @@ void AddBoundaryInputs(const InternalKeyComparator& icmp,
}
}
void VersionSet::SetupOtherInputs(Compaction* c, bool is_last_level) {
void VersionSet::SetupOtherInputs(Compaction* c) {
const int level = c->level();
InternalKey smallest, largest;
@ -1390,7 +1390,7 @@ void VersionSet::SetupOtherInputs(Compaction* c, bool is_last_level) {
GetRange(c->inputs_[0], &smallest, &largest);
// TTL: manual compaction for last level shouldn't have inputs[1]
if (!is_last_level) {
if (!c->is_last_level()) {
current_->GetOverlappingInputs(level + 1, &smallest, &largest,
&c->inputs_[1]);
AddBoundaryInputs(icmp_, current_->files_[level + 1], &c->inputs_[1]);
@ -1477,7 +1477,7 @@ Compaction* VersionSet::CompactRange(int level, const InternalKey* begin,
c->input_version_ = current_;
c->input_version_->Ref();
c->inputs_[0] = inputs;
SetupOtherInputs(c, is_last_level);
SetupOtherInputs(c);
return c;
}

+ 1
- 1
db/version_set.h View File

@ -286,7 +286,7 @@ class VersionSet {
const std::vector<FileMetaData*>& inputs2,
InternalKey* smallest, InternalKey* largest);
void SetupOtherInputs(Compaction* c, bool is_last_level);
void SetupOtherInputs(Compaction* c);
// Save current contents to *log
Status WriteSnapshot(log::Writer* log);

Loading…
Cancel
Save