aboutsummaryrefslogtreecommitdiffstats
path: root/thread_win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread_win32.c')
-rw-r--r--thread_win32.c10
1 files changed, 2 insertions, 8 deletions
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();
{