Method: Array#empty?

Defined in:
array.c

#empty?Boolean

Returns true if self contains no elements.

[].empty?   #=> true

Returns:

  • (Boolean)


2229
2230
2231
2232
2233
2234
2235
# File 'array.c', line 2229

static VALUE
rb_ary_empty_p(VALUE ary)
{
    if (RARRAY_LEN(ary) == 0)
	return Qtrue;
    return Qfalse;
}