[ruby/forwardable] Remove string allocation in def_{instance,single}_delegators
https://github.com/ruby/forwardable/commit/1a994c90e1
This commit is contained in:
parent
d00551a7bb
commit
0098977053
@ -150,7 +150,7 @@ module Forwardable
|
||||
#
|
||||
def def_instance_delegators(accessor, *methods)
|
||||
methods.each do |method|
|
||||
next if method.to_s == "__send__" || method.to_s == "__id__"
|
||||
next if /\A__(?:send|id)__\z/ =~ method
|
||||
def_instance_delegator(accessor, method)
|
||||
end
|
||||
end
|
||||
@ -286,7 +286,7 @@ module SingleForwardable
|
||||
#
|
||||
def def_single_delegators(accessor, *methods)
|
||||
methods.each do |method|
|
||||
next if method.to_s == "__send__" || method.to_s == "__id__"
|
||||
next if /\A__(?:send|id)__\z/ =~ method
|
||||
def_single_delegator(accessor, method)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user