summaryrefslogtreecommitdiff
path: root/src/mscorlib
diff options
context:
space:
mode:
authorJames Ko <jamesqko@gmail.com>2017-07-08 16:38:23 -0400
committerJan Kotas <jkotas@microsoft.com>2017-07-08 22:38:23 +0200
commite616560d5de4ccb39d846860eee27ff8806f28b2 (patch)
tree6c1e53ff7912f620182944f16d4c7a84915f61da /src/mscorlib
parentc28b3c9f928ba0ff1be6727dcbdb9ba8d1522a82 (diff)
downloadcoreclr-e616560d5de4ccb39d846860eee27ff8806f28b2.tar.gz
coreclr-e616560d5de4ccb39d846860eee27ff8806f28b2.tar.bz2
coreclr-e616560d5de4ccb39d846860eee27ff8806f28b2.zip
Remove redundant call to TimeSpan.TotalMilliseconds (#12692)
Diffstat (limited to 'src/mscorlib')
-rw-r--r--src/mscorlib/src/System/Threading/SpinWait.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mscorlib/src/System/Threading/SpinWait.cs b/src/mscorlib/src/System/Threading/SpinWait.cs
index 6bd2ca354f..b7c9e22d46 100644
--- a/src/mscorlib/src/System/Threading/SpinWait.cs
+++ b/src/mscorlib/src/System/Threading/SpinWait.cs
@@ -210,15 +210,15 @@ namespace System.Threading
public static bool SpinUntil(Func<bool> condition, TimeSpan timeout)
{
// Validate the timeout
- Int64 totalMilliseconds = (Int64)timeout.TotalMilliseconds;
- if (totalMilliseconds < -1 || totalMilliseconds > Int32.MaxValue)
+ long totalMilliseconds = (long)timeout.TotalMilliseconds;
+ if (totalMilliseconds < -1 || totalMilliseconds > int.MaxValue)
{
throw new System.ArgumentOutOfRangeException(
nameof(timeout), timeout, SR.SpinWait_SpinUntil_TimeoutWrong);
}
// Call wait with the timeout milliseconds
- return SpinUntil(condition, (int)timeout.TotalMilliseconds);
+ return SpinUntil(condition, (int)totalMilliseconds);
}
/// <summary>