diff --git a/db/compaction/compaction.cc b/db/compaction/compaction.cc index 53895fa7c46..fc76f93f1c5 100644 --- a/db/compaction/compaction.cc +++ b/db/compaction/compaction.cc @@ -686,12 +686,11 @@ bool Compaction::KeyRangeNotExistsBeyondOutputLevel( }; // Mark (or clear) each file that is being compacted -void Compaction::MarkFilesBeingCompacted(bool mark_as_compacted) { +void Compaction::MarkFilesBeingCompacted(bool being_compacted) const { for (size_t i = 0; i < num_input_levels(); i++) { for (size_t j = 0; j < inputs_[i].size(); j++) { - assert(mark_as_compacted ? !inputs_[i][j]->being_compacted - : inputs_[i][j]->being_compacted); - inputs_[i][j]->being_compacted = mark_as_compacted; + assert(being_compacted != inputs_[i][j]->being_compacted); + inputs_[i][j]->being_compacted = being_compacted; } } } diff --git a/db/compaction/compaction.h b/db/compaction/compaction.h index ad2ce2172f7..633e68a9eac 100644 --- a/db/compaction/compaction.h +++ b/db/compaction/compaction.h @@ -436,7 +436,7 @@ class Compaction { const int output_level); // mark (or clear) all files that are being compacted - void MarkFilesBeingCompacted(bool mark_as_compacted); + void MarkFilesBeingCompacted(bool being_compacted) const; private: