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