path performance optimization

This commit is contained in:
kayone 2013-11-30 16:33:59 -08:00
parent 0503d7eea6
commit 91d64f0b6a
9 changed files with 28 additions and 22 deletions

View file

@ -40,10 +40,12 @@ namespace NzbDrone.Common
{
if (OsInfo.IsLinux)
{
if (firstPath.Equals(secondPath)) return true;
return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath());
}
return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), StringComparison.InvariantCultureIgnoreCase);
if (firstPath.Equals(secondPath, StringComparison.OrdinalIgnoreCase)) return true;
return String.Equals(firstPath.CleanFilePath(), secondPath.CleanFilePath(), StringComparison.OrdinalIgnoreCase);
}
private static readonly Regex WindowsPathWithDriveRegex = new Regex(@"^[a-zA-Z]:\\", RegexOptions.Compiled);