From 453617006a5481fda9b3e7639d9049a2a281a2da Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 10 Jul 2013 20:03:41 +0900 Subject: 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) --- activesupport/lib/active_support/core_ext/string/filters.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') 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 -- cgit v1.2.3