Skip to content

Commit 580eda5

Browse files
committed
Improved a comment, fixed a typo
1 parent 8baecc2 commit 580eda5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Microsoft.Toolkit.HighPerformance/Enumerables/SpanEnumerable{T}.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ public readonly Item Current
7878
ref T r0 = ref MemoryMarshal.GetReference(this.span);
7979
ref T ri = ref Unsafe.Add(ref r0, this.index);
8080

81-
// On .NET Standard 2.1 we can save 4 bytes by piggybacking
82-
// the current index in the length of the wrapped span.
83-
// We're going to use the first item as the target reference,
84-
// and the length as a host for the current original offset.
85-
// This is not possible on .NET Standard 2.1 as we lack
86-
// the API to create spans from arbitrary references.
81+
// On .NET Standard 2.1 and .NET Core (or on any target that offers runtime
82+
// support for the Span<T> types), we can save 4 bytes by piggybacking the
83+
// current index in the length of the wrapped span. We're going to use the
84+
// first item as the target reference, and the length as a host for the
85+
// current original offset. This is not possible on eg. .NET Standard 2.0,
86+
// as we lack the API to create Span<T>-s from arbitrary references.
8787
return new Item(ref ri, this.index);
8888
#else
8989
return new Item(this.span, this.index);

0 commit comments

Comments
 (0)