diff --git a/src/database/graph_db_accessor.cpp b/src/database/graph_db_accessor.cpp index 01cb7b1a6..a0551544e 100644 --- a/src/database/graph_db_accessor.cpp +++ b/src/database/graph_db_accessor.cpp @@ -74,7 +74,7 @@ void GraphDbAccessor::BuildIndex(const GraphDbTypes::Label &label, // on function exit switch the build_in_progress to false utils::OnScopeExit on_exit([this] { bool expected = true; - bool success = + [[maybe_unused]] bool success = db_.index_build_in_progress_.compare_exchange_strong(expected, false); debug_assert(success, "BuildIndexInProgress flag was not set during build"); }); diff --git a/src/database/indexes/index_common.hpp b/src/database/indexes/index_common.hpp index 3fe00581d..d8931f408 100644 --- a/src/database/indexes/index_common.hpp +++ b/src/database/indexes/index_common.hpp @@ -155,7 +155,8 @@ static void Refresh( indices_entries_accessor.insert( TIndexEntry(indices_entry, new_record)); - auto success = indices_entries_accessor.remove(indices_entry); + [[maybe_unused]] auto success = + indices_entries_accessor.remove(indices_entry); debug_assert(success, "Unable to delete entry."); } diff --git a/tests/concurrent/sl_hang.cpp b/tests/concurrent/sl_hang.cpp index bce9ad583..8b7926d7d 100644 --- a/tests/concurrent/sl_hang.cpp +++ b/tests/concurrent/sl_hang.cpp @@ -14,15 +14,15 @@ TEST(SkipList, HangDuringFindOrLarger) { const int num_of_threads = 8; const int iter = 100000; for (int i = 0; i < num_of_threads; ++i) { - threads.emplace_back([&iter, &skiplist]() { + threads.emplace_back([&skiplist]() { auto accessor = skiplist.access(); for (int i = 0; i < iter; ++i) accessor.insert(rand() % 3); }); - threads.emplace_back([&iter, &skiplist]() { + threads.emplace_back([&skiplist]() { auto accessor = skiplist.access(); for (int i = 0; i < iter; ++i) accessor.remove(rand() % 3); }); - threads.emplace_back([&iter, &skiplist]() { + threads.emplace_back([&skiplist]() { auto accessor = skiplist.access(); for (int i = 0; i < iter; ++i) accessor.find_or_larger(rand() % 3);