Merge pull request #2771 from warwickmm/refactor/avoid_unnecessary_enumeration
Avoid unnecessary enumeration
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user