diff options
author | Jeremy Evans <code@jeremyevans.net> | 2019-08-21 07:33:28 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-10-26 09:25:11 +0900 |
commit | 00989770535cfe69e618a2c556dad44610042e13 (patch) | |
tree | 65d86caf05626a532611d8f5911d74f79575b6b9 | |
parent | d00551a7bb1d5dbabb0a8c95d6bd2d9d4e86934a (diff) | |
download | bundler-00989770535cfe69e618a2c556dad44610042e13.tar.gz |
[ruby/forwardable] Remove string allocation in def_{instance,single}_delegators
https://github.com/ruby/forwardable/commit/1a994c90e1
-rw-r--r-- | lib/forwardable.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/forwardable.rb b/lib/forwardable.rb index 3ca8a252dd..924c605c6e 100644 --- a/lib/forwardable.rb +++ b/lib/forwardable.rb @@ -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 |