Prefer 0.000001 over 0.000001f for timeout calculations. (#12803)

This commit is contained in:
Samuel Williams 2025-02-25 16:37:21 +13:00 committed by GitHub
parent 3198b46a36
commit d32fa5283f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2025-02-25 03:37:37 +00:00
Merged-By: ioquatix <samuel@codeotaku.com>
2 changed files with 2 additions and 2 deletions

View File

@ -271,7 +271,7 @@ VALUE
rb_fiber_scheduler_make_timeout(struct timeval *timeout)
{
if (timeout) {
return rb_float_new((double)timeout->tv_sec + (0.000001f * timeout->tv_usec));
return rb_float_new((double)timeout->tv_sec + (0.000001 * timeout->tv_usec));
}
return Qnil;

View File

@ -241,7 +241,7 @@ VALUE io_spec_rb_wait_for_single_fd(VALUE self, VALUE io, VALUE events, VALUE se
#ifdef RUBY_VERSION_IS_3_0
VALUE timeout = Qnil;
if (!NIL_P(secs)) {
timeout = rb_float_new((double)FIX2INT(secs) + (0.000001f * FIX2INT(usecs)));
timeout = rb_float_new((double)FIX2INT(secs) + (0.000001 * FIX2INT(usecs)));
}
VALUE result = rb_io_wait(io, events, timeout);
if (result == Qfalse) return INT2FIX(0);