summaryrefslogtreecommitdiff
path: root/ext/sdbm
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-22 07:18:55 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-22 07:18:55 +0000
commitdd53157c9e1b352de0e7f41a863aeaf6ba298724 (patch)
treeec130d9d4e701446a7e66577723b1f32c8746be6 /ext/sdbm
parentde7a010a502517d7a38d702646f2101e48a50129 (diff)
gdbm, dbm, sdbm: remove unnecessary conditions
The dfree and dsize callback functions are never called with NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/sdbm')
-rw-r--r--ext/sdbm/init.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index de99b07..f28eeb2 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -99,12 +99,10 @@ free_sdbm(void *ptr)
static size_t
memsize_dbm(const void *ptr)
{
- size_t size = 0;
const struct dbmdata *dbmp = ptr;
- if (dbmp) {
- size += sizeof(*dbmp);
- if (dbmp->di_dbm) size += sizeof(DBM);
- }
+ size_t size = sizeof(*dbmp);
+ if (dbmp->di_dbm)
+ size += sizeof(DBM);
return size;
}