Skip to content

Commit 5f6a539

Browse files
authored
Provide HashSet size when possible (#11809)
Fixes # ### Context ### Changes Made ### Testing ### Notes
2 parents 50fd7fb + f621a8d commit 5f6a539

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Framework/BinaryTranslator.cs

+4
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,11 @@ public void Translate(ref HashSet<string> set)
303303
}
304304

305305
int count = _reader.ReadInt32();
306+
#if NET472_OR_GREATER || NET9_0_OR_GREATER
307+
set = new HashSet<string>(count);
308+
#else
306309
set = new HashSet<string>();
310+
#endif
307311

308312
for (int i = 0; i < count; i++)
309313
{

0 commit comments

Comments
 (0)