Merge pull request #2771 from warwickmm/refactor/avoid_unnecessary_enumeration

Avoid unnecessary enumeration
This commit is contained in:
Kenneth Skovhede
2017-09-28 11:02:33 +02:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
@@ -214,7 +214,7 @@ namespace Duplicati.Library.Modules.Builtin
if (paths == null || !Utility.Utility.IsClientWindows)
return false;
return paths.Where(x => !string.IsNullOrWhiteSpace(x)).Where(x => x.Equals(m_HyperVPathAllRegExp, StringComparison.OrdinalIgnoreCase) || Regex.IsMatch(x, m_HyperVPathGuidRegExp, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)).Count() > 0;
return paths.Where(x => !string.IsNullOrWhiteSpace(x)).Where(x => x.Equals(m_HyperVPathAllRegExp, StringComparison.OrdinalIgnoreCase) || Regex.IsMatch(x, m_HyperVPathGuidRegExp, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)).Any();
}
#endregion
@@ -211,7 +211,7 @@ namespace Duplicati.Library.Modules.Builtin
if (paths == null || !Utility.Utility.IsClientWindows)
return false;
return paths.Where(x => !string.IsNullOrWhiteSpace(x)).Where(x => x.Equals(m_MSSQLPathAllRegExp, StringComparison.OrdinalIgnoreCase) || Regex.IsMatch(x, m_MSSQLPathDBRegExp, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)).Count() > 0;
return paths.Where(x => !string.IsNullOrWhiteSpace(x)).Where(x => x.Equals(m_MSSQLPathAllRegExp, StringComparison.OrdinalIgnoreCase) || Regex.IsMatch(x, m_MSSQLPathDBRegExp, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)).Any();
}
#endregion