Repository navigation
Replace object_id comparison with identity Hash - #7303
Conversation
|
Thanks for opening a pull request and helping make RubyGems and Bundler better! Someone from the RubyGems team will take a look at your pull request shortly and leave any feedback. Please make sure that your pull request has tests for any changes or added functionality. We use GitHub Actions to test and make sure your change works functionally and uses acceptable conventions, you can review the current progress of GitHub Actions in the PR status window below. If you have any questions or concerns that you wish to ask, feel free to leave a comment in this PR or join our #rubygems or #bundler channel on Slack. For more information about contributing to the RubyGems project feel free to review our CONTRIBUTING guide |
|
Thanks for merging! @martinemde |
|
@amomchilov I did the easy part 😀 Thank you for finding and contributing this back to rubygems! |
(cherry picked from commit 6d4b73f)
What was the end-user or developer problem that led to this PR?
Found this while auditing uses of
object_idinruby/ruby. Pulled out from ruby/ruby#9276What is your fix for the problem, implemented in this PR?
Replace a
Hashkeyed byobject_ids with an identity Hash. SeeHash#compare_by_identity](https://ruby-doc.org/3.2.2/Hash.html#method-i-compare_by_identity), which has the same semantics, but is faster and doesn't trigger allocation of IDs for these objects.Make sure the following tasks are checked
Write tests for features and bug fixes