summaryrefslogtreecommitdiffstats
path: root/ext/sdbm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sdbm')
-rw-r--r--ext/sdbm/init.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c
index 2dfd17196..0f9ae1dbf 100644
--- a/ext/sdbm/init.c
+++ b/ext/sdbm/init.c
@@ -475,14 +475,12 @@ fsdbm_store(obj, keystr, valstr)
}
fdbm_modify(obj);
- keystr = rb_obj_as_string(keystr);
+ StringValue(keystr);
key.dptr = RSTRING(keystr)->ptr;
key.dsize = RSTRING(keystr)->len;
- if (NIL_P(valstr)) return fsdbm_delete(obj, keystr);
-
- valstr = rb_obj_as_string(valstr);
+ StringValue(valstr);
val.dptr = RSTRING(valstr)->ptr;
val.dsize = RSTRING(valstr)->len;