Skip to content

Commit

Permalink
Use for loop to avoid heap allocated enumerator.
Browse files Browse the repository at this point in the history
  • Loading branch information
Washi1337 committed Jun 25, 2022
1 parent c7039c5 commit e871718
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/AsmResolver.Symbols.Pdb/Metadata/Info/InfoStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ public override void Write(IBinaryStreamWriter writer)
writer.WriteUInt32(0);

// Write feature codes.
foreach (var feature in Features)
writer.WriteUInt32((uint) feature);
var features = Features;
for (int i = 0; i < features.Count; i++)
writer.WriteUInt32((uint) features[i]);
}

private static uint ComputeStringHash(Utf8String str)
Expand Down

0 comments on commit e871718

Please sign in to comment.