From fbc42a09333dc7b028e39f565cc7d02aa6f3d313 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Thu, 20 Nov 2014 13:44:37 -0800 Subject: [PATCH] Fixed -Werror=unused-but-set-variable in thread_status_impl Summary: Fixed -Werror=unused-but-set-variable in thread_status_impl --- util/thread_status_impl.cc | 3 +-- util/thread_status_impl_debug.cc | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/util/thread_status_impl.cc b/util/thread_status_impl.cc index 24be214f8..d07a60463 100644 --- a/util/thread_status_impl.cc +++ b/util/thread_status_impl.cc @@ -68,8 +68,7 @@ Status ThreadStatusImpl::GetThreadList( std::memory_order_relaxed); auto cf_key = thread_data->cf_key.load( std::memory_order_relaxed); - auto iter = cf_info_map_.find( - thread_data->cf_key.load(std::memory_order_relaxed)); + auto iter = cf_info_map_.find(cf_key); assert(cf_key == 0 || iter != cf_info_map_.end()); auto* cf_info = iter != cf_info_map_.end() ? iter->second : nullptr; diff --git a/util/thread_status_impl_debug.cc b/util/thread_status_impl_debug.cc index 1def2b143..5717e40c3 100644 --- a/util/thread_status_impl_debug.cc +++ b/util/thread_status_impl_debug.cc @@ -16,7 +16,7 @@ void ThreadStatusImpl::TEST_VerifyColumnFamilyInfoMap( assert(cf_info_map_.size() == handles.size()); for (auto* handle : handles) { auto* cfd = reinterpret_cast(handle)->cfd(); - auto iter = cf_info_map_.find(cfd); + auto iter __attribute__((unused)) = cf_info_map_.find(cfd); assert(iter != cf_info_map_.end()); assert(iter->second); assert(iter->second->cf_name == cfd->GetName());