You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
738 B
33 lines
738 B
using System;
|
|
using System.Collections.Generic;
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
namespace NzbDrone.Common
|
|
{
|
|
public class PathEqualityComparer : IEqualityComparer<string>
|
|
{
|
|
public static readonly PathEqualityComparer Instance = new PathEqualityComparer();
|
|
|
|
private PathEqualityComparer()
|
|
{
|
|
|
|
}
|
|
|
|
public bool Equals(string x, string y)
|
|
{
|
|
return x.PathEquals(y);
|
|
}
|
|
|
|
public int GetHashCode(string obj)
|
|
{
|
|
if (OsInfo.IsWindows)
|
|
{
|
|
return obj.CleanFilePath().ToLower().GetHashCode();
|
|
}
|
|
|
|
return obj.CleanFilePath().GetHashCode();
|
|
}
|
|
}
|
|
}
|