Skip to content

Commit a5908a7

Browse files
committed
Simplified enumerator
1 parent cc6c4f8 commit a5908a7

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/LinkDotNet.StringBuilder/ValueStringBuilder.Enumerator.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ public readonly ref char Current
3333
/// <summary>Advances the enumerator to the next element of the span.</summary>
3434
/// <returns>True if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the span.</returns>
3535
[MethodImpl(MethodImplOptions.AggressiveInlining)]
36-
public bool MoveNext()
37-
{
38-
var nextIndex = index + 1;
39-
if (nextIndex < span.Length)
40-
{
41-
index = nextIndex;
42-
return true;
43-
}
44-
45-
return false;
46-
}
36+
public bool MoveNext() => ++index < span.Length;
4737
}
4838
}

0 commit comments

Comments
 (0)