From d33657a4a5ebba9d3aa2a896a67eaad8131773f0 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Thu, 3 Jul 2014 17:19:17 -0700 Subject: [PATCH] Fixed a warning in release mode. Summary: Removed a variable that is only used in assertion check. Test Plan: make release Reviewers: ljin, sdong Reviewed By: sdong Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D19455 --- db/db_impl.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/db_impl.cc b/db/db_impl.cc index c56acecf8..6862f9a77 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -3796,15 +3796,21 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) { RecordTick(options_.statistics.get(), WRITE_DONE_BY_OTHER, 1); return w.status; } else if (timed_out) { +#ifndef NDEBUG bool found = false; +#endif for (auto iter = writers_.begin(); iter != writers_.end(); iter++) { if (*iter == &w) { writers_.erase(iter); +#ifndef NDEBUG found = true; +#endif break; } } +#ifndef NDEBUG assert(found); +#endif // writers_.front() might still be in cond_wait without a time-out. // As a result, we need to signal it to wake it up. Otherwise no // one else will wake him up, and RocksDB will hang.