-
-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No equality operators for IUser (and possibly others) #912
Comments
|
I can wrangle the return type for |
|
Like I noted, you can always use the IDs if (restUserObject.Id == socketUserObject.Id)
return; |
Keep in mind that we already tried something like this in #181 and it ended up being postponed almost indefinitely. However, this is a good place to discuss it properly, so cc @RogueException @foxbot |
There seem to be two solutions for this. Here's the code I'm using as suggested by @khionu:
And the other option is implementing an The solution I'm using now definitely works, though I would very much be in favor of seeing a handful of |
If we're gonna add comparers to the base library, then I nominate to consider the one I linked, because it works perfectly and I've spent a good amount of time refining it to get lazy-initialization with low overhead. |
@Joe4evr if you want to PR yours, seems good to me - I don't see any reason why we shouldn't have these |
I second |
Should probably be closed now that comparers have been added. |
This makes it impossible to use LINQ and other built-in methods for ensuring that objects are equal to each other. Will submit a pull request with this.
usersToRemove
ends up being the same asusersInGuild
. I'll try and find a less-painful solution than doing things manually.The text was updated successfully, but these errors were encountered: