public const int ManagedResourcesDataAlignment = 8;
- private const string CorEntryPointDll = "mscoree.dll";
- private string CorEntryPointName => (ImageCharacteristics & Characteristics.Dll) != 0 ? "_CorDllMain" : "_CorExeMain";
+ private static ReadOnlySpan<byte> CorEntryPointDll => "mscoree.dll"u8;
+ private ReadOnlySpan<byte> CorEntryPointName => (ImageCharacteristics & Characteristics.Dll) != 0 ? "_CorDllMain"u8 : "_CorExeMain"u8;
private int SizeOfImportAddressTable => RequiresStartupStub ? (Is32Bit ? 2 * sizeof(uint) : 2 * sizeof(ulong)) : 0;
// Hint table
builder.WriteUInt16(0); // Hint 54|58
- foreach (char ch in CorEntryPointName)
- {
- builder.WriteByte((byte)ch); // 65|69
- }
-
+ builder.WriteBytes(CorEntryPointName); // 65|69
builder.WriteByte(0); // 66|70
Debug.Assert(builder.Count - start == SizeOfImportTable);
}
{
int start = builder.Count;
- foreach (char ch in CorEntryPointDll)
- {
- builder.WriteByte((byte)ch);
- }
-
+ builder.WriteBytes(CorEntryPointDll);
builder.WriteByte(0);
builder.WriteUInt16(0);
Debug.Assert(builder.Count - start == SizeOfNameTable);