Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgorBo <egorbo@gmail.com>2018-06-01 10:23:38 +0300
committerMarek Safar <marek.safar@gmail.com>2018-06-01 17:54:26 +0300
commit957ba72461bc1a6b69fb7e120b906b5cd98cfb35 (patch)
tree48e33a0ec91a6ecf2f1b9b193916646897ab4ee5
parent8d8d683b93ddeb1d240afaa832f6f790c6045f83 (diff)
Add `using System.Diagnostics.Private;` to TimeSpan*.cs
-rw-r--r--src/Common/src/CoreLib/System/Globalization/TimeSpanFormat.cs13
-rw-r--r--src/Common/src/CoreLib/System/Globalization/TimeSpanParse.cs3
2 files changed, 14 insertions, 2 deletions
diff --git a/src/Common/src/CoreLib/System/Globalization/TimeSpanFormat.cs b/src/Common/src/CoreLib/System/Globalization/TimeSpanFormat.cs
index a66e4600aa..075f1eae3a 100644
--- a/src/Common/src/CoreLib/System/Globalization/TimeSpanFormat.cs
+++ b/src/Common/src/CoreLib/System/Globalization/TimeSpanFormat.cs
@@ -4,6 +4,7 @@
using System.Text;
using System.Diagnostics;
+using System.Diagnostics.Private;
using System.Runtime.InteropServices;
namespace System.Globalization
@@ -316,7 +317,17 @@ namespace System.Globalization
if (nextChar >= 0 && nextChar != (int)'%')
{
char nextCharChar = (char)nextChar;
- StringBuilder origStringBuilder = FormatCustomized(value, MemoryMarshal.CreateReadOnlySpan<char>(ref nextCharChar, 1), dtfi, result);
+ ReadOnlySpan<char> nextCharSpan;
+#if MONO
+ // Remove once Mono switches to Fast Spans
+ unsafe
+ {
+ nextCharSpan = new ReadOnlySpan<char>(&nextCharChar, 1);
+ }
+#else
+ nextCharSpan = MemoryMarshal.CreateReadOnlySpan<char>(ref nextCharChar, 1);
+#endif
+ StringBuilder origStringBuilder = FormatCustomized(value, nextCharSpan, dtfi, result);
Debug.Assert(ReferenceEquals(origStringBuilder, result));
tokenLen = 2;
}
diff --git a/src/Common/src/CoreLib/System/Globalization/TimeSpanParse.cs b/src/Common/src/CoreLib/System/Globalization/TimeSpanParse.cs
index 51fac39d0a..c6475e02d9 100644
--- a/src/Common/src/CoreLib/System/Globalization/TimeSpanParse.cs
+++ b/src/Common/src/CoreLib/System/Globalization/TimeSpanParse.cs
@@ -49,11 +49,12 @@
////////////////////////////////////////////////////////////////////////////
using System.Diagnostics;
+using System.Diagnostics.Private;
using System.Text;
namespace System.Globalization
{
- internal static class TimeSpanParse
+ internal static partial class TimeSpanParse
{
private const int MaxFractionDigits = 7;
private const int MaxDays = 10675199;