Method: List#compact!

Defined in:
ext/list/list.c

#compact!Object



2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
# File 'ext/list/list.c', line 2189

static VALUE
list_compact_bang(VALUE self)
{
  long len;

  list_modify_check(self);
  len = LIST_LEN(self);
  list_delete(self, Qnil);
  if (len == LIST_LEN(self)) {
    return Qnil;
  }
  return self;
}