diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-29 13:37:42 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-29 13:37:42 -0700 |
commit | 96525d632d47847ae5a8d6658ad396b74ecfb6f1 (patch) | |
tree | 32e63e245a607258fcadb9385ec41b7009d599f2 /activesupport/lib | |
parent | eb3f81f9dce7a7e22ff228a564408daeef09a11e (diff) | |
download | rails-96525d632d47847ae5a8d6658ad396b74ecfb6f1.tar.gz rails-96525d632d47847ae5a8d6658ad396b74ecfb6f1.tar.bz2 rails-96525d632d47847ae5a8d6658ad396b74ecfb6f1.zip |
avoid creating range objects
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/array/access.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/access.rb b/activesupport/lib/active_support/core_ext/array/access.rb index 2df4fd1da1..6162f7af27 100644 --- a/activesupport/lib/active_support/core_ext/array/access.rb +++ b/activesupport/lib/active_support/core_ext/array/access.rb @@ -16,7 +16,7 @@ class Array # %w( a b c d ).to(10) # => %w( a b c d ) # %w().to(0) # => %w() def to(position) - self[0..position] + self.first position + 1 end # Equal to <tt>self[1]</tt>. |