From 2883fcd849ca7b479d8a2f4fc929f0b6c7b9e372 Mon Sep 17 00:00:00 2001 From: ivanabc Date: Tue, 21 Jun 2016 16:57:57 +0800 Subject: [PATCH] set const property --- db/db_impl.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index c6da3a6..cc1cea4 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -224,9 +224,9 @@ void DBImpl::DeleteObsoleteFiles() { return; } - uint64_t log_number = versions_->LogNumber(); - uint64_t prev_log_number = versions_->PrevLogNumber(); - uint64_t manifest_file_number = versions_->ManifestFileNumber(); + const uint64_t log_number = versions_->LogNumber(); + const uint64_t prev_log_number = versions_->PrevLogNumber(); + const uint64_t manifest_file_number = versions_->ManifestFileNumber(); // Make a set of all of the live files std::set live = pending_outputs_; @@ -235,7 +235,9 @@ void DBImpl::DeleteObsoleteFiles() { std::vector filenames; env_->GetChildren(dbname_, &filenames); // Ignoring errors on purpose + // Unlock while deleting obsolete files mutex_.Unlock(); + uint64_t number; FileType type; for (size_t i = 0; i < filenames.size(); i++) {