From 034b5215013600e644bd346c5273bd2ea65c2000 Mon Sep 17 00:00:00 2001 From: Stefano Borzì Date: Sun, 5 Mar 2023 18:47:18 +0100 Subject: feat(CI): add cppcheck (#15211) Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com> --- src/server/database/Database/Transaction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/database/Database') diff --git a/src/server/database/Database/Transaction.cpp b/src/server/database/Database/Transaction.cpp index 38f2ab051e..d5cf4fcebf 100644 --- a/src/server/database/Database/Transaction.cpp +++ b/src/server/database/Database/Transaction.cpp @@ -110,7 +110,7 @@ bool TransactionTask::Execute() // Make sure only 1 async thread retries a transaction so they don't keep dead-locking each other std::lock_guard lock(_deadlockLock); - for (Milliseconds loopDuration = 0s, startMSTime = GetTimeMS(); loopDuration <= DEADLOCK_MAX_RETRY_TIME_MS; loopDuration = GetMSTimeDiffToNow(startMSTime)) + for (Milliseconds loopDuration{}, startMSTime = GetTimeMS(); loopDuration <= DEADLOCK_MAX_RETRY_TIME_MS; loopDuration = GetMSTimeDiffToNow(startMSTime)) { if (!TryExecute()) return true; @@ -157,7 +157,7 @@ bool TransactionWithResultTask::Execute() // Make sure only 1 async thread retries a transaction so they don't keep dead-locking each other std::lock_guard lock(_deadlockLock); - for (Milliseconds loopDuration = 0s, startMSTime = GetTimeMS(); loopDuration <= DEADLOCK_MAX_RETRY_TIME_MS; loopDuration = GetMSTimeDiffToNow(startMSTime)) + for (Milliseconds loopDuration{}, startMSTime = GetTimeMS(); loopDuration <= DEADLOCK_MAX_RETRY_TIME_MS; loopDuration = GetMSTimeDiffToNow(startMSTime)) { if (!TryExecute()) { -- cgit v1.2.3