Index: base/threading/platform_thread_win.cc |
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc |
index 80f353a8b46f3a7c8241cb2247ec252037ec2ca8..3df371943f5e6fdf1a91175802b7fb36f78d9aba 100644 |
--- a/base/threading/platform_thread_win.cc |
+++ b/base/threading/platform_thread_win.cc |
@@ -150,9 +150,8 @@ void PlatformThread::Sleep(TimeDelta duration) { |
// When measured with a high resolution clock, Sleep() sometimes returns much |
// too early. We may need to call it repeatedly to get the desired duration. |
TimeTicks end = TimeTicks::Now() + duration; |
- TimeTicks now; |
- while ((now = TimeTicks::Now()) < end) |
- ::Sleep((end - now).InMillisecondsRoundedUp()); |
+ for (TimeTicks now = TimeTicks::Now(); now < end; now = TimeTicks::Now()) |
+ ::Sleep(static_cast<DWORD>((end - now).InMillisecondsRoundedUp())); |
} |
// static |