aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2013-07-10 20:03:41 +0900
committerAkira Matsuda <ronnie@dio.jp>2013-07-10 22:59:32 +0900
commit453617006a5481fda9b3e7639d9049a2a281a2da (patch)
tree6b2af1cd4958160cf8769b4bf7f3b60b9b2d4cae /activesupport
parentaf4b6545eef0035ea14e4d7480ade0a395aef1b8 (diff)
downloadrails-453617006a5481fda9b3e7639d9049a2a281a2da.tar.gz
rails-453617006a5481fda9b3e7639d9049a2a281a2da.tar.bz2
rails-453617006a5481fda9b3e7639d9049a2a281a2da.zip
Speed up String#truncate
Benchmark: user system total real old 1.550000 0.040000 1.590000 ( 1.585866) new 1.250000 0.040000 1.290000 ( 1.287693)
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/string/filters.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/filters.rb b/activesupport/lib/active_support/core_ext/string/filters.rb
index c62bb41416..91d91e10e1 100644
--- a/activesupport/lib/active_support/core_ext/string/filters.rb
+++ b/activesupport/lib/active_support/core_ext/string/filters.rb
@@ -50,6 +50,6 @@ class String
length_with_room_for_omission
end
- "#{self[0...stop]}#{options[:omission]}"
+ "#{self[0, stop]}#{options[:omission]}"
end
end