Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Jun 17, 2022
1 parent 3e49297 commit d3b8f3a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1878,11 +1878,9 @@ private void ZeroToMaxLen(int cUI4sCur) {
//Precision Length
// 0 invalid
// 1-9 1
// 10-19 2
// 20-28 3
// 29-38 4
// The array in Shiloh. Listed here for comparison.
// {5,5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,9,9,13,13,13,13,13,13,13,13,13,17,17,17,17,17,17,17,17,17,17};
// 10-19 2
// 20-28 3
// 29-38 4
private static ReadOnlySpan<byte> RgCLenFromPrec => new byte[] // rely on C# compiler optimization to eliminate allocation
{
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,9 @@ ref int ciulU // InOut| # of digits
//Precision Length
// 0 invalid
// 1-9 1
// 10-19 2
// 20-28 3
// 29-38 4
// The array in Shiloh. Listed here for comparison.
// {5,5,5,5,5,5,5,5,5,9,9,9,9,9,9,9,9,9,9,13,13,13,13,13,13,13,13,13,17,17,17,17,17,17,17,17,17,17};
// 10-19 2
// 20-28 3
// 29-38 4
private static ReadOnlySpan<byte> RgCLenFromPrec => new byte[] { // rely on C# compiler optimization to eliminate allocation
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ private static unsafe void WritePESignature(BlobBuilder builder)
builder.WriteUInt32(PEHeaders.PESignature);
}

private static ReadOnlySpan<byte> DosHeader => new byte[0x80]
internal const int DosHeaderSize = 0x80;

private static ReadOnlySpan<byte> DosHeader => new byte[DosHeaderSize]
{
0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
Expand All @@ -187,8 +189,6 @@ private static unsafe void WritePESignature(BlobBuilder builder)
0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

internal const int DosHeaderSize = 0x80;

private void WriteCoffHeader(BlobBuilder builder, ImmutableArray<SerializedSection> sections, out Blob stampFixup)
{
// Machine
Expand Down

0 comments on commit d3b8f3a

Please sign in to comment.