diff options
Diffstat (limited to 'ext/sdbm/init.c')
-rw-r--r-- | ext/sdbm/init.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c index 65e2ded07b..1795024ff9 100644 --- a/ext/sdbm/init.c +++ b/ext/sdbm/init.c @@ -714,21 +714,20 @@ fsdbm_empty_p(VALUE obj) datum key; struct dbmdata *dbmp; DBM *dbm; - int i = 0; GetDBM(obj, dbmp); if (dbmp->di_size < 0) { dbm = dbmp->di_dbm; for (key = sdbm_firstkey(dbm); key.dptr; key = sdbm_nextkey(dbm)) { - i++; + return Qfalse; } } else { - i = dbmp->di_size; + if (!dbmp->di_size) + return Qfalse; } - if (i == 0) return Qtrue; - return Qfalse; + return Qtrue; } /* |