neosmart / unicode.net

A Unicode library for .NET, supporting UTF8, UTF16, and UTF32. With an extra helping of emoji for good measure 🔥🌶️😁
MIT License
87 stars 23 forks source link

SingleEmoji.Equals(SingleEmoji x, SingleEmoji y) #4

Closed COM8 closed 5 years ago

COM8 commented 5 years ago

https://github.com/neosmart/unicode.net/blob/3b0bd1867c96221b344084d8d82278f7c6a812b8/unicode/SingleEmoji.cs#L32

Shouldn't this be return x.Sequence == y.Sequence;?

I will create a PR for this.

mqudsi commented 5 years ago

No, that method shouldn't exist. There should be a static Equals function taking two SingleEmoji instances as parameters and a non-static member function taking one SingleEmoji parameter. It should also implement IEquatable<SingleEmoji>.

COM8 commented 5 years ago

No, that method shouldn't exist. There should be a static Equals function taking two SingleEmoji instances as parameters and a non-static member function taking one SingleEmoji parameter. It should also implement IEquatable<SingleEmoji>.

Will update my PR and fix this for SingleEmoji and UnicodeSequence

COM8 commented 5 years ago

IEqualityComparer<SingleEmoji> requires it to exist. I keept it and added one in the UnicodeSequence class.

ee5fed0 Should fix this.