Skip to content

Use encoding objects for comparison instead of encoding names #2418

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 2 commits into from
Feb 17, 2022

Conversation

casperisfine
Copy link
Contributor

Comparing the names is much less efficient than
comparing the instance directly.

It may also change in the future: https://bugs.ruby-lang.org/issues/18576

casperisfine and others added 2 commits February 17, 2022 16:04
Comparing the names is much less efficient than
comparing the instance directly.

It may also change in the future: https://bugs.ruby-lang.org/issues/18576
@p-mongo
Copy link
Contributor

p-mongo commented Feb 17, 2022

To clarify, the primary purpose of this change is to permit Ruby to possibly rename ascii-8bit encoding into binary at some point in the future. The performance impact of this comparison is not significant because it happens in the test suite.

@p-mongo p-mongo changed the title Stop checking encoding names Use encoding objects for comparison instead of encoding names Feb 17, 2022
@casperisfine
Copy link
Contributor Author

The performance impact of this comparison is not significant because it happens in the test suite.

Yeah sorry. I just sent 31 similar pull requests, so I just copy pasted the commit message.

@p-mongo p-mongo merged commit 823bb97 into mongodb:master Feb 17, 2022
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.

5 participants