aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2013-07-10 17:14:33 +0900
committerAkira Matsuda <ronnie@dio.jp>2013-07-10 17:14:33 +0900
commitcd0d5902dd237794049cac1ee89ab0c07a16a851 (patch)
tree7c2d5ce19edc5bf8054909f05cebda47284ab20e /activesupport
parent2ef1fb2c455ca53a0c1e1768f50824926ce28bd3 (diff)
downloadrails-cd0d5902dd237794049cac1ee89ab0c07a16a851.tar.gz
rails-cd0d5902dd237794049cac1ee89ab0c07a16a851.tar.bz2
rails-cd0d5902dd237794049cac1ee89ab0c07a16a851.zip
Speedup AS::Inflector.deconstantize
Benchmark: user system total real old 0.740000 0.000000 0.740000 ( 0.744358) new 0.550000 0.000000 0.550000 ( 0.553690)
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/inflector/methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb
index 9ca5a388f8..18c94a4997 100644
--- a/activesupport/lib/active_support/inflector/methods.rb
+++ b/activesupport/lib/active_support/inflector/methods.rb
@@ -184,7 +184,7 @@ module ActiveSupport
#
# See also +demodulize+.
def deconstantize(path)
- path.to_s[0...(path.rindex('::') || 0)] # implementation based on the one in facets' Module#spacename
+ path.to_s[0, path.rindex('::') || 0] # implementation based on the one in facets' Module#spacename
end
# Creates a foreign key name from a class name.