Skip to content

Remove unnecessary self as a return value of initialize method #897

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
Aug 5, 2019

Conversation

pocke
Copy link
Contributor

@pocke pocke commented Aug 5, 2019

initialize method returned value is not used usually. Because the method is called by Class.new.
So the self are not necessary.

note

If it is called explicitly, the caller can use the returned value. But it is a super rare case.

class C
  def initialize
    1
  end
end


c = C.new
p c.__send__ :initialize # => 1

@estolfo
Copy link
Contributor

estolfo commented Aug 5, 2019

thanks!

@estolfo estolfo merged commit 82e1db0 into elastic:master Aug 5, 2019
@pocke pocke deleted the remove-unnecessary-self branch August 5, 2019 16:53
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