summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--thread_win32.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/thread_win32.c b/thread_win32.c
index 49c1436..d573632 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();
{