reject!()
public
Equivalent to Hash#delete_if, but returns nil if no changes were made.
Show source
VALUE
rb_hash_reject_bang(VALUE hash)
{
st_index_t n;
RETURN_ENUMERATOR(hash, 0, 0);
rb_hash_modify(hash);
if (!RHASH(hash)->ntbl)
return Qnil;
n = RHASH(hash)->ntbl->num_entries;
rb_hash_foreach(hash, delete_if_i, hash);
if (n == RHASH(hash)->ntbl->num_entries) return Qnil;
return hash;
}