diff --git a/thread_win32.c b/thread_win32.c index 49c143603b..d573632550 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -301,14 +301,8 @@ rb_w32_Sleep(unsigned long msec) static void native_sleep(rb_thread_t *th, struct timeval *tv) { - DWORD msec; - - if (tv) { - msec = tv->tv_sec * 1000 + tv->tv_usec / 1000; - } - else { - msec = INFINITE; - } + const DWORD msec = (tv) ? + (DWORD)(tv->tv_sec * 1000 + tv->tv_usec / 1000) : INFINITE; GVL_UNLOCK_BEGIN(); {