Permalink
Browse files

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)
  • Loading branch information...
1 parent 2ef1fb2 commit cd0d5902dd237794049cac1ee89ab0c07a16a851 @amatsuda amatsuda committed Jul 10, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/inflector/methods.rb
@@ -184,7 +184,7 @@ def demodulize(path)
#
# 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.

0 comments on commit cd0d590

Please sign in to comment.