Fixed SocketRole.CompareTo

This commit is contained in:
RogueException
2017-03-02 06:55:09 -04:00
parent 8c75e0d581
commit 1b0e47be42
3 changed files with 5 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
namespace Discord
{
internal static class RoleUtils
{
public static int Compare(IRole left, IRole right)
{
if (left == null)
return -1;
if (right == null)
return 1;
var result = left.Position.CompareTo(right.Position);
// As per Discord's documentation, a tie is broken by ID
if (result != 0)
return result;
return left.Id.CompareTo(right.Id);
}
}
}