Skip to content

Commit

Permalink
[].from(0) actually returns [], not nil
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Dec 16, 2009
1 parent b67dc00 commit 25550d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/core_ext/array/access.rb
Expand Up @@ -4,7 +4,7 @@ class Array
# %w( a b c d ).from(0) # => %w( a b c d ) # %w( a b c d ).from(0) # => %w( a b c d )
# %w( a b c d ).from(2) # => %w( c d ) # %w( a b c d ).from(2) # => %w( c d )
# %w( a b c d ).from(10) # => nil # %w( a b c d ).from(10) # => nil
# %w().from(0) # => nil # %w().from(0) # => %w()
def from(position) def from(position)
self[position..-1] self[position..-1]
end end
Expand Down

0 comments on commit 25550d9

Please sign in to comment.