From 6313ceaac08f2cbdb09a9e560bf1330f30940a78 Mon Sep 17 00:00:00 2001 From: Stefan van Kessel Date: Tue, 31 Oct 2023 04:35:28 +0100 Subject: [PATCH] fix: remove unused variable (#4677) With clang 15, an unused-but-set-variable warning was emitted: PostgresDatabase.cpp:178:14: warning: variable 'expNumResults' set but not used [-Wunused-but-set-variable] uint32_t expNumResults = 1; --- src/ripple/app/rdb/backend/impl/PostgresDatabase.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ripple/app/rdb/backend/impl/PostgresDatabase.cpp b/src/ripple/app/rdb/backend/impl/PostgresDatabase.cpp index 5ee4ce5519d..c57dee30610 100644 --- a/src/ripple/app/rdb/backend/impl/PostgresDatabase.cpp +++ b/src/ripple/app/rdb/backend/impl/PostgresDatabase.cpp @@ -175,8 +175,6 @@ loadLedgerInfos( "total_coins, closing_time, prev_closing_time, close_time_res, " "close_flags, ledger_seq FROM ledgers "; - uint32_t expNumResults = 1; - if (auto ledgerSeq = std::get_if(&whichLedger)) { sql << "WHERE ledger_seq = " + std::to_string(*ledgerSeq); @@ -189,8 +187,6 @@ loadLedgerInfos( auto minAndMax = std::get_if>(&whichLedger)) { - expNumResults = minAndMax->second - minAndMax->first; - sql << ("WHERE ledger_seq >= " + std::to_string(minAndMax->first) + " AND ledger_seq <= " + std::to_string(minAndMax->second));