mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
32 lines
701 B
C#
32 lines
701 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
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.IsMono)
|
|
{
|
|
return obj.CleanFilePath().GetHashCode();
|
|
}
|
|
|
|
return obj.CleanFilePath().ToLower().GetHashCode();
|
|
}
|
|
}
|
|
}
|