SImplify capacity presetting for Dictionary to handle memory slack scale internally as suers care about items count only

This commit is contained in:
Wojtek Figat
2025-01-16 17:42:01 +01:00
parent 6111f67e33
commit 1497acef58
9 changed files with 26 additions and 25 deletions

View File

@@ -262,7 +262,7 @@ bool Animation::SaveTimeline(BytesContainer& data)
Events.Clear();
NestedAnims.Clear();
Dictionary<int32, int32> animationChannelTrackIndexToChannelIndex;
animationChannelTrackIndexToChannelIndex.EnsureCapacity(tracksCount * 3);
animationChannelTrackIndexToChannelIndex.EnsureCapacity(tracksCount);
for (int32 trackIndex = 0; trackIndex < tracksCount; trackIndex++)
{
const byte trackType = stream.ReadByte();