-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[corlib] Default to fast Span<T> (#9204)
Part of #7249
- Loading branch information
1 parent
493153f
commit 262c5f4
Showing
28 changed files
with
398 additions
and
144 deletions.
There are no files selected for viewing
Submodule api-snapshot
updated
3 files
+30 −6 | profiles/monodroid/mscorlib.cs | |
+30 −6 | profiles/monotouch/mscorlib.cs | |
+30 −6 | profiles/net_4_x/mscorlib.cs |
Submodule corefx
updated
4 files
Submodule corert
updated
2 files
+0 −8 | src/System.Private.CoreLib/src/System/Array.cs | |
+4 −3 | src/System.Private.CoreLib/src/System/String.cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,11 +34,19 @@ | |
// | ||
// | ||
|
||
#if BIT64 | ||
using nuint = System.UInt64; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jaykrell
Contributor
|
||
#else | ||
using nuint = System.UInt32; | ||
#endif | ||
|
||
using System.Runtime.CompilerServices; | ||
using System.Text; | ||
using System.Globalization; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Runtime.InteropServices; | ||
using System.Diagnostics.Private; | ||
|
||
namespace System | ||
{ | ||
|
@@ -51,15 +59,6 @@ partial class String | |
|
||
public static readonly String Empty; | ||
|
||
public unsafe static implicit operator ReadOnlySpan<char> (String value) | ||
{ | ||
if (value == null) | ||
return default; | ||
|
||
fixed (void* start = &value._firstChar) | ||
return new ReadOnlySpan<char> (start, value.Length); | ||
} | ||
|
||
internal unsafe int IndexOfUnchecked (string value, int startIndex, int count) | ||
{ | ||
int valueLen = value.Length; | ||
|
@@ -202,7 +201,12 @@ internal bool StartsWithOrdinalUnchecked (String value) | |
if (this.Length < value.Length || _firstChar != value._firstChar) | ||
return false; | ||
|
||
return value.Length == 1 ? true : StartsWithOrdinalHelper (this, value); | ||
return value.Length == 1 ? | ||
true : | ||
SpanHelpers.SequenceEqual ( | ||
ref Unsafe.As<char, byte> (ref this.GetRawStringData ()), | ||
ref Unsafe.As<char, byte> (ref value.GetRawStringData ()), | ||
((nuint)value.Length) * 2); | ||
} | ||
|
||
[MethodImplAttribute (MethodImplOptions.InternalCall)] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
How does this not break 32bit builds?