Skip to content

Commit f68a47a

Browse files
authored
CodeGenerator.EmitStackAlloc - Avoid capturing blob array (#76660)
1 parent 71681a6 commit f68a47a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Compilers/CSharp/Portable/CodeGen/EmitStackAllocInitializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private void EmitStackAlloc(TypeSymbol type, BoundArrayInitialization? inits, Bo
4545
var sizeInBytes = elementType.EnumUnderlyingTypeOrSelf().SpecialType.SizeInBytes();
4646

4747
ImmutableArray<byte> data = GetRawData(initExprs);
48-
if (data.All(datum => datum == data[0]))
48+
if (data.All(static (d, first) => d == first, data[0]))
4949
{
5050
// All bytes are the same, no need for metadata blob, just initblk to fill it with the repeated value.
5151
_builder.EmitOpCode(ILOpCode.Dup);

0 commit comments

Comments
 (0)