method

length

Importance_0
v1_9_3_125 - Show latest stable - 0 notes - Class: SDBM
length() public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
static VALUE
fsdbm_length(VALUE obj)
{
    datum key;
    struct dbmdata *dbmp;
    DBM *dbm;
    int i = 0;

    GetDBM2(obj, dbmp, dbm);
    if (dbmp->di_size > 0) return INT2FIX(dbmp->di_size);

    for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) {
        i++;
    }
    dbmp->di_size = i;

    return INT2FIX(i);
}
Register or log in to add new notes.