Skip to content

Commit eef526e

Browse files
authored
Fix stale TODO in BufferedFileStreamStrategy (#117302)
1 parent cc37cdd commit eef526e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/libraries/System.Private.CoreLib/src/System/IO/Strategies/BufferedFileStreamStrategy.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,15 +1026,12 @@ private void EnsureBufferAllocated()
10261026
if (_buffer is null)
10271027
{
10281028
AllocateBuffer();
1029-
}
1030-
}
10311029

1032-
// TODO https://github.com/dotnet/roslyn/issues/47896: should be local function in EnsureBufferAllocated above.
1033-
[MemberNotNull(nameof(_buffer))]
1034-
[MethodImpl(MethodImplOptions.NoInlining)]
1035-
private void AllocateBuffer()
1036-
{
1037-
Interlocked.CompareExchange(ref _buffer, GC.AllocateUninitializedArray<byte>(_bufferSize), null);
1030+
[MemberNotNull(nameof(_buffer))]
1031+
[MethodImpl(MethodImplOptions.NoInlining)]
1032+
void AllocateBuffer() =>
1033+
Interlocked.CompareExchange(ref _buffer, GC.AllocateUninitializedArray<byte>(_bufferSize), null);
1034+
}
10381035
}
10391036

10401037
[Conditional("DEBUG")]

0 commit comments

Comments
 (0)