Skip to content

Remove pointless unsafe block in CilAssembler.cs #47

@SeeminglyScience

Description

@SeeminglyScience

byte* rawSignature = stackalloc byte[encoder.Builder.Count];
byte* c = rawSignature;
foreach (Blob blob in blobEncoder.Builder.GetBlobs())
{
foreach (byte b in blob.GetBytes())
{
*c++ = b;
}
}
_context.ILInfo.SetLocalSignature(rawSignature, blobEncoder.Builder.Count);

Saves one minor heap allocation every assemble, but not really worth the readability loss and the stackalloc doesn't guard against stack overflow.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions