Skip to content

CSHARP-4413: Equality operator of MongoClientSettings is bugged #976

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

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

BorisDog
Copy link
Contributor

No description provided.

@@ -1109,7 +1109,7 @@ public override bool Equals(object obj)
_useTls == rhs._useTls &&
_waitQueueSize == rhs._waitQueueSize &&
_waitQueueTimeout == rhs._waitQueueTimeout &&
_writeConcern == rhs._writeConcern &&
object.Equals(_writeConcern, rhs._writeConcern) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better implementing operator ==?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I thought this might be BC, but looks like it's minor. Thoughts @DmitryLukyanov ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's a BC, but I also think it's minor and I don't see how it can affect users, so I think it's better to do it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as a general rule Equals should be implemented in terms of Equals.

Sometimes we rely on == being equivalent to Equals but to me it's clearer if Equals is implemented using Equals.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DmitryLukyanov we address this in CSHARP-4432

Copy link
Contributor

@DmitryLukyanov DmitryLukyanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BorisDog BorisDog merged commit 3fd0538 into mongodb:master Nov 28, 2022
dnickless pushed a commit to dnickless/mongo-csharp-driver that referenced this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants