summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/zlib/zlib.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index c550f46..e5a1e67 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -3188,13 +3188,9 @@ rb_gzfile_set_mtime(VALUE obj, VALUE mtime)
rb_raise(cGzError, "header is already written");
}
- if (FIXNUM_P(mtime)) {
- gz->mtime = FIX2INT(mtime);
- }
- else {
- val = rb_Integer(mtime);
- gz->mtime = FIXNUM_P(val) ? FIX2UINT(val) : rb_big2ulong(val);
- }
+ val = rb_Integer(mtime);
+ gz->mtime = NUM2UINT(val);
+
return mtime;
}