mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
c1ad9a5fd1
commit
5d325e6a9e
2 changed files with 13 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
Sat Feb 13 17:07:20 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* array.c (rb_ary_delete): RDoc update. a patch from Hugh Sasse.
|
||||
[ruby-core:28128]
|
||||
|
||||
* array.c (rb_ary_compact_bang): ditto.
|
||||
|
||||
Sat Feb 13 15:01:24 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* marshal.c (id2encidx): duplicated entry for encoding name.
|
||||
|
|
9
array.c
9
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 <i>self</i> that are equal to <i>obj</i>. If
|
||||
* Deletes items from <i>self</i> that are equal to <i>obj</i>.
|
||||
* If any items are found, returns <i>obj</i>. If
|
||||
* the item is not found, returns <code>nil</code>. If the optional
|
||||
* code block is given, returns the result of <i>block</i> if the item
|
||||
* is not found.
|
||||
* is not found. (To remove <code>nil</code> 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
|
||||
* </i>array</i>.
|
||||
*
|
||||
* [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ]
|
||||
* [ "a", "b", "c" ].compact! #=> nil
|
||||
|
|
Loading…
Reference in a new issue