/*
* call-seq:
* array.nitems -> int
*
* Returns the number of non-<code>nil</code> elements in _self_.
*
* May be zero.
*
* [ 1, nil, 3, nil, 5 ].nitems #=> 3
*/
static VALUE
rb_ary_nitems(ary)
VALUE ary;
{
long n = 0;
VALUE *p, *pend;
for (p = RARRAY(ary)->ptr, pend = p + RARRAY(ary)->len; p < pend; p++) {
if (!NIL_P(*p)) n++;
}
return LONG2NUM(n);
}