From 98c4e7eed0443085ffd1554baae99cbe45a8c9c4 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 22 Jan 2018 21:23:41 +0100 Subject: [PATCH] Minor optimization --- .../Main/Operation/Common/BackendHandlerDatabaseGuard.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Duplicati/Library/Main/Operation/Common/BackendHandlerDatabaseGuard.cs b/Duplicati/Library/Main/Operation/Common/BackendHandlerDatabaseGuard.cs index 33adbb64e..bc8a68b3d 100644 --- a/Duplicati/Library/Main/Operation/Common/BackendHandlerDatabaseGuard.cs +++ b/Duplicati/Library/Main/Operation/Common/BackendHandlerDatabaseGuard.cs @@ -150,7 +150,13 @@ namespace Duplicati.Library.Main.Operation.Common var prevqueue = m_workQueue; lock (m_lock) + { + // No need to fiddle if nothing has happened + if (prevqueue.Count == 0) + return; + m_workQueue = new List>>(); + } // We repeat here to allow quicker progress in case the backend is blocked // on a log message, and emits a new one immediately after having one handled