Skip to content

Conversation

@jeremyevans
Copy link
Contributor

Previously, send and id were skipped if provided as strings,
but not skipped if provided as symbols.

Fixes Ruby Bug 8855.

Previously, __send__ and __id__ were skipped if provided as strings,
but not skipped if provided as symbols.

Fixes Ruby Bug 8855.
methods.delete("__id__")
for method in methods
methods.each do |method|
next if method.to_s == "__send__" || method.to_s == "__id__"
Copy link
Member

@znz znz Aug 21, 2019

Choose a reason for hiding this comment

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

I think next if /\A__(?:send|id)__\z/ =~ method is better because of reducing String objects creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, that makes sense.

@znz znz merged commit 46a3f69 into ruby:master Oct 1, 2019
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.

2 participants