From 5d325e6a9e3d01a07191875b55f98496efb75e6e Mon Sep 17 00:00:00 2001 From: matz Date: Sat, 13 Feb 2010 08:08:19 +0000 Subject: * array.c (rb_ary_delete): RDoc update. a patch from Hugh Sasse. [ruby-core:28128] * array.c (rb_ary_compact_bang): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index 2b147c3ffd..a6c03e9248 100644 --- a/array.c +++ b/array.c @@ -2253,10 +2253,12 @@ rb_ary_select(VALUE ary) * array.delete(obj) -> obj or nil * array.delete(obj) { block } -> obj or nil * - * Deletes items from self that are equal to obj. If + * Deletes items from self that are equal to obj. + * If any items are found, returns obj. If * the item is not found, returns nil. If the optional * code block is given, returns the result of block if the item - * is not found. + * is not found. (To remove nil elements and + * get an informative return value, use #compact!) * * a = [ "a", "b", "b", "b", "c" ] * a.delete("b") #=> "b" @@ -3384,7 +3386,8 @@ rb_ary_uniq(VALUE ary) * array.compact! -> array or nil * * Removes +nil+ elements from array. - * Returns +nil+ if no changes were made. + * Returns +nil+ if no changes were made, otherwise return + * array. * * [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ] * [ "a", "b", "c" ].compact! #=> nil -- cgit v1.2.3