8000 Backport of performance for forwardable by tenderlove · Pull Request #37 · github/ruby · GitHub
[go: up one dir, main page]

Skip to content

Backport of performance for forwardable #37

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
forwardable.rb: fix branches
* lib/forwardable.rb (instance_delegate, single_delegate): fix
  inverted branches.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu authored and tenderlove committed Jun 8, 2017
commit f3229e37b9a22d33ef07f906e7d7971d5e76ef85
4 changes: 2 additions & 2 deletions lib/forwardable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class << self
#
def instance_delegate(hash)
hash.each do |methods, accessor|
if defined?(methods.each)
unless defined?(methods.each)
def_instance_delegator(accessor, methods)
else
methods.each {|method| def_instance_delegator(accessor, method)}
Expand Down Expand Up @@ -263,7 +263,7 @@ module SingleForwardable
#
def single_delegate(hash)
hash.each do |methods, accessor|
if defined?(methods.each)
unless defined?(methods.each)
def_single_delegator(accessor, methods)
else
methods.each {|method| def_single_delegator(accessor, method)}
Expand Down
0