From 137c376675e03fa66e4c6b7c7f9ca95963012019 Mon Sep 17 00:00:00 2001 From: Ari Ekmekji Date: Wed, 19 Aug 2015 08:52:22 -0700 Subject: [PATCH] Removing variables used only in assertions to prevent build error Summary: A couple variables were declared but only used in assertions which causes issues when building in fbcode. Test Plan: make dbg and make release Reviewers: yhchiang, sdong, igor, anthony, MarkCallaghan Reviewed By: MarkCallaghan Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D44937 --- db/compaction_job.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/db/compaction_job.cc b/db/compaction_job.cc index 51295b5ea..cad3f1bb3 100644 --- a/db/compaction_job.cc +++ b/db/compaction_job.cc @@ -285,14 +285,13 @@ void CompactionJob::Prepare() { ThreadStatus::STAGE_COMPACTION_PREPARE); // Generate file_levels_ for compaction berfore making Iterator - ColumnFamilyData* cfd = compact_->compaction->column_family_data(); - assert(cfd != nullptr); - - assert(cfd->current()->storage_info()->NumLevelFiles( - compact_->compaction->level()) > 0); + auto* c = compact_->compaction; + assert(c->column_family_data() != nullptr); + assert(c->column_family_data()->current()->storage_info() + ->NumLevelFiles(compact_->compaction->level()) > 0); // Is this compaction producing files at the bottommost level? - bottommost_level_ = compact_->compaction->bottommost_level(); + bottommost_level_ = c->bottommost_level(); // Initialize subcompaction states SequenceNumber earliest_snapshot; @@ -367,7 +366,6 @@ void CompactionJob::InitializeSubCompactions(const SequenceNumber& earliest, size_t index = 0; while (files_left > 1 && subcompactions_left > 1) { - // Cheaper way to do 'round(num_files / num_subcompactions)' num_to_include = files_left / subcompactions_left; index += num_to_include; sub_compaction_boundaries_.emplace_back(candidates[index]); @@ -529,7 +527,8 @@ void CompactionJob::ProcessKeyValueCompaction(SubCompactionState* sub_compact) { bool has_current_user_key = false; IterKey delete_key; - SequenceNumber last_sequence_for_key = kMaxSequenceNumber; + SequenceNumber last_sequence_for_key __attribute__((unused)) = + kMaxSequenceNumber; SequenceNumber visible_in_snapshot = kMaxSequenceNumber; ColumnFamilyData* cfd = sub_compact->compaction->column_family_data(); MergeHelper merge(cfd->user_comparator(), cfd->ioptions()->merge_operator,