aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-06-10 13:04:50 -0400
committerGitHub <noreply@github.com>2016-06-10 13:04:50 -0400
commit7fd477c0f53bd59549e5f4db65917284e29f9d0b (patch)
treeae8ed7f3b080669d6cab8951d44fb8ed6464a2f5 /activesupport
parentcb4d18d31aeeca4bce6377246f8e0f6c35054717 (diff)
parente8148a5cf401b677227397680c3d8a99ef747770 (diff)
downloadrails-7fd477c0f53bd59549e5f4db65917284e29f9d0b.tar.gz
rails-7fd477c0f53bd59549e5f4db65917284e29f9d0b.tar.bz2
rails-7fd477c0f53bd59549e5f4db65917284e29f9d0b.zip
Merge pull request #25352 from Shopify/optimized-delegate
Replace Kernel#caller by the faster Kernel#caller_locations
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb
index 7f968d10b5..3f6e8bd26c 100644
--- a/activesupport/lib/active_support/core_ext/module/delegation.rb
+++ b/activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -164,8 +164,8 @@ class Module
''
end
- file, line = caller(1, 1).first.split(':'.freeze, 2)
- line = line.to_i
+ location = caller_locations(1, 1).first
+ file, line = location.path, location.lineno
to = to.to_s
to = "self.#{to}" if DELEGATION_RESERVED_METHOD_NAMES.include?(to)