fix(core): Updates slice with range selectors (#583)

- [X] Replaces Span slicing with range selection
- [X] Replaces string slicing with range selection
This commit is contained in:
Kamron Batman 2021-04-23 20:57:24 -07:00 • committed by GitHub
parent 9f9d990f85
commit a0893b68c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 363 additions and 382 deletions

View file

@ -133,7 +133,7 @@ namespace Benchmarks
buffer, Serial.MinusOne, -1, MessageType.Regular, 0x3B2, 3, "ENU", "System", text
);
buffer = buffer.SliceToLength(length);
buffer = buffer[..length];
foreach (var pipe in _pipes)
{
@ -152,7 +152,7 @@ namespace Benchmarks
buffer, Serial.MinusOne, -1, MessageType.Regular, 0x3B2, 3, "ENU", "System", text
);
buffer = buffer.SliceToLength(length);
buffer = buffer[..length];
var result = pipe.Writer.TryGetMemory();
result.CopyFrom(buffer);
pipe.Writer.Advance((uint)buffer.Length);