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

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2018-06-08 21:05:34 +0300
committerMarek Safar <marek.safar@gmail.com>2018-07-10 16:38:34 +0300
commit68876d2a32048178c974b841d170999e73e0cece (patch)
tree81d02e1004f765548ed65c469a163a405578ba10
parentaf496fc1c27c9886fdb6ea1ac967ba8d549e8ccc (diff)
Get Fast Span to compilefast-span
-rw-r--r--src/System.Private.CoreLib/src/System/Array.cs8
-rw-r--r--src/System.Private.CoreLib/src/System/String.cs7
2 files changed, 4 insertions, 11 deletions
diff --git a/src/System.Private.CoreLib/src/System/Array.cs b/src/System.Private.CoreLib/src/System/Array.cs
index 2822401ff..12412a28f 100644
--- a/src/System.Private.CoreLib/src/System/Array.cs
+++ b/src/System.Private.CoreLib/src/System/Array.cs
@@ -910,22 +910,14 @@ namespace System
if (array.Length - index < length)
throw new ArgumentException(SR.Argument_InvalidOffLen);
-#if !MONO
ref T p = ref Unsafe.As<byte, T>(ref array.GetRawSzArrayData());
-#endif
int i = index;
int j = index + length - 1;
while (i < j)
{
-#if MONO
- T temp = array[i];
- array[i] = array[j];
- array[j] = temp;
-#else
T temp = Unsafe.Add(ref p, i);
Unsafe.Add(ref p, i) = Unsafe.Add(ref p, j);
Unsafe.Add(ref p, j) = temp;
-#endif
i++;
j--;
}
diff --git a/src/System.Private.CoreLib/src/System/String.cs b/src/System.Private.CoreLib/src/System/String.cs
index bb238f940..9ad81657e 100644
--- a/src/System.Private.CoreLib/src/System/String.cs
+++ b/src/System.Private.CoreLib/src/System/String.cs
@@ -402,8 +402,10 @@ namespace System
}
return result;
}
-
-#if !MONO // TODO: Undo
+#if MONO
+ public delegate void SpanAction<T, in TArg>(Span<T> span, TArg arg);
+ public delegate void ReadOnlySpanAction<T, in TArg>(ReadOnlySpan<T> span, TArg arg);
+#endif
public static string Create<TState>(int length, TState state, SpanAction<char, TState> action)
{
if (action == null)
@@ -428,7 +430,6 @@ namespace System
public static implicit operator ReadOnlySpan<char>(string value) =>
value != null ? new ReadOnlySpan<char>(ref value.GetRawStringData(), value.Length) : default;
-#endif
public object Clone()
{