Skip to content

Commit 15a8d86

Browse files
committed
Optimize logic in SliceLongerSpanToMatchShorterLength
1 parent 82ce59a commit 15a8d86

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4990,11 +4990,8 @@ private static void SliceLongerSpanToMatchShorterLength<T>(ref ReadOnlySpan<T> s
49904990
{
49914991
other = other.Slice(0, span.Length);
49924992
}
4993-
else if (span.Length > other.Length)
4994-
{
4995-
span = span.Slice(0, other.Length);
4996-
}
4997-
Debug.Assert(span.Length == other.Length);
4993+
4994+
span = span.Slice(0, other.Length);
49984995
}
49994996

50004997
/// <summary>

0 commit comments

Comments
 (0)