From 94bbd10ea71120d7f21e1025d1f1a3b804db770e Mon Sep 17 00:00:00 2001 From: hsbt Date: Fri, 11 Jul 2014 07:00:49 +0000 Subject: [PATCH] * array.c: Clarify documentation for Array#insert. [ruby-core:62934] [Bug #9901] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ array.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 38a70bd606..4525808225 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jul 11 15:59:42 2014 SHIBATA Hiroshi + + * array.c: Clarify documentation for Array#insert. + [ruby-core:62934] [Bug #9901] + Fri Jul 11 15:39:36 2014 SHIBATA Hiroshi * io.c: Improve Documentation by @dapplebeforedawn. diff --git a/array.c b/array.c index dc1dad6d16..0bfbfb4fd1 100644 --- a/array.c +++ b/array.c @@ -1742,7 +1742,9 @@ fixnum: * Inserts the given values before the element with the given +index+. * * Negative indices count backwards from the end of the array, where +-1+ is - * the last element. + * the last element. If a negative index is used, the given values will be + * inserted after that element, so using an index of +-1+ will insert the + * values at the end of the array. * * a = %w{ a b c d } * a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]