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
Remove unused var, replace temps and block.call with yield #83
Conversation
end | ||
end | ||
|
||
if block_given? | ||
if block.arity == 1 | ||
block.call(self) | ||
yield self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To actually get a memory/performance benefit from this change you also need to remove the &block
in the definition of this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we won't get the memory savings because we need block
on line 26. But we should see a slight increase in speed.
So @ridiculous has a good set of changes here. @cyu: Could you please take some time to review this? |
I still need a block to check the |
Should I revert the |
@cyu: Investigating the arity stuff to see if we can get rid of |
@ridiculous: So I investigated this, and if block_given?
block = Proc.new
if block.arity == 1
block.call self
else
instance_eval(&block)
end
end |
@dirk the Having said that, the |
Is there a change that is being requested on this PR? |
No description provided.