Browse Source

fix: Changed Emote GetHashCode to not include Name (#1317)

Continuation of commit abf3e90 attempt to fix Emote comparisons,
as Hash comparisons are done before Equals in Comparers
tags/2.1.1
Tiago Cabral Christopher F 6 years ago
parent
commit
1b54883896
1 changed files with 1 additions and 7 deletions
  1. +1
    -7
      src/Discord.Net.Core/Entities/Emotes/Emote.cs

+ 1
- 7
src/Discord.Net.Core/Entities/Emotes/Emote.cs View File

@@ -54,13 +54,7 @@ namespace Discord
}

/// <inheritdoc />
public override int GetHashCode()
{
unchecked
{
return (Name.GetHashCode() * 397) ^ Id.GetHashCode();
}
}
public override int GetHashCode() => Id.GetHashCode();

/// <summary> Parses an <see cref="Emote"/> from its raw format. </summary>
/// <param name="text">The raw encoding of an emote (e.g. <c>&lt;:dab:277855270321782784&gt;</c>).</param>


Loading…
Cancel
Save