public static bool TryParseInt32(ReadOnlySpan<byte> text, out int value, out int bytesConsumed)
{
int textLength = text.Length;
if (textLength < 1) goto FalseExit;
int sign = 1;
int index = default;
int num = text[index];
namespace System.Buffers.Text {
public static class Base64 {
public static int ComputeDecodedLength(ReadOnlySpan<byte> source);
public static int ComputeEncodedLength(int sourceLength);
public static TransformationStatus Decode(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten);
public static TransformationStatus DecodeInPlace(Span<byte> buffer, out int bytesConsumed, out int bytesWritten);
public static TransformationStatus Encode(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out int bytesWritten);
public static TransformationStatus EncodeInPlace(Span<byte> buffer, int sourceLength, out int bytesWritten);
}
This file contains hidden or 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
Started by user Ahson Khan | |
Building in workspace C:\Program Files (x86)\Jenkins\workspace\testLinux | |
> git.exe rev-parse --is-inside-work-tree # timeout=10 | |
Fetching changes from the remote Git repository | |
> git.exe config remote.origin.url https://github.com/dotnet/dotnet-ci # timeout=10 | |
Fetching upstream changes from https://github.com/dotnet/dotnet-ci | |
> git.exe --version # timeout=10 | |
> git.exe fetch --tags --progress https://github.com/dotnet/dotnet-ci +refs/heads/*:refs/remotes/origin/* # timeout=30 | |
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10 | |
> git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10 |
Here are the latest results and conclusion.
Essentially, for Span specifically, calling Slice then IndexOf is just as good (if not better) than calling the IndexOf overload which removes the need to Slice.
(I am limiting the discussion to fast span since the conclusion doesn’t generally change for slow span)
NewerOlder