From 0c1ac9c489de2a8a36641da234a5a28865348b4a Mon Sep 17 00:00:00 2001 From: Kenneth Hsu Date: Sat, 6 Oct 2018 15:50:05 -0700 Subject: Replace chained LINQ calls with call to overload with predicate. This simplifies the code by reducing the number of enumerators created while also making the code slightly more readable. --- Duplicati/Library/Main/BackendManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Duplicati/Library/Main/BackendManager.cs') diff --git a/Duplicati/Library/Main/BackendManager.cs b/Duplicati/Library/Main/BackendManager.cs index 49e00f44d..b467090f2 100644 --- a/Duplicati/Library/Main/BackendManager.cs +++ b/Duplicati/Library/Main/BackendManager.cs @@ -749,7 +749,7 @@ namespace Duplicati.Library.Main if (m_options.ListVerifyUploads) { - var f = m_backend.List().Where(n => n.Name.Equals(item.RemoteFilename, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); + var f = m_backend.List().FirstOrDefault(n => n.Name.Equals(item.RemoteFilename, StringComparison.OrdinalIgnoreCase)); if (f == null) throw new Exception(string.Format("List verify failed, file was not found after upload: {0}", item.RemoteFilename)); else if (f.Size != item.Size && f.Size >= 0) -- cgit v1.2.3