Skip to content

Commit 17c9b23

Browse files
committed
Try remove cctor run
1 parent 879c3cf commit 17c9b23

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/coreclr/System.Private.CoreLib/src/System/Array.CoreCLR.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ ref CastHelpers.Unbox(pDestMT, obj),
198198
}
199199

200200
// Will box each element in an array of value classes or primitives into an array of Objects.
201-
[UnconditionalSuppressMessage("Trimming", "IL2059:The type passed to the RunClassConstructor is not statically known, Trimmer can't make sure that its static constructor is available.", Justification = "The type handle is retrieved from existing array.")]
202201
private static unsafe void CopyImplBoxEachElement(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
203202
{
204203
MethodTable* pSrcArrayMT = RuntimeHelpers.GetMethodTable(sourceArray);
@@ -209,8 +208,6 @@ private static unsafe void CopyImplBoxEachElement(Array sourceArray, int sourceI
209208

210209
MethodTable* pSrcMT = srcTH.AsMethodTable();
211210

212-
RuntimeHelpers.RunClassConstructor(RuntimeTypeHandle.FromIntPtr((nint)pSrcMT)); // pSrcMT->CheckRunClassInitThrowing
213-
214211
nuint srcSize = pSrcArrayMT->ComponentSize;
215212
ref byte data = ref Unsafe.AddByteOffset(ref MemoryMarshal.GetArrayDataReference(sourceArray), (nuint)sourceIndex * srcSize);
216213
ref object? destData = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(Unsafe.As<object?[]>(destinationArray)), destinationIndex);

0 commit comments

Comments
 (0)