[DOC] Tweaks to Array#compact!

This commit is contained in:
BurdetteLamar 2024-08-24 15:57:47 +01:00 committed by Peter Zhu
parent 418e85b120
commit e962c9c4c3

12
array.c
View File

@ -6285,11 +6285,17 @@ rb_ary_uniq(VALUE ary)
/* /*
* call-seq: * call-seq:
* array.compact! -> self or nil * compact! -> self or nil
* *
* Removes all +nil+ elements from +self+. * Removes all +nil+ elements from +self+;
* Returns +self+ if any elements are removed, +nil+ otherwise:
* *
* Returns +self+ if any elements removed, otherwise +nil+. * a = [nil, 0, nil, false, nil, '', nil, [], nil, {}]
* a.compact! # => [0, false, "", [], {}]
* a # => [0, false, "", [], {}]
* a.compact! # => nil
*
* Related: Array#compact.
*/ */
static VALUE static VALUE