From 735e2fc9fe99151dbb115bd0ea9ebe8d31277dd1 Mon Sep 17 00:00:00 2001 From: VladiStep Date: Sun, 29 Jan 2023 21:27:11 +0300 Subject: [PATCH] Optimized "UndertaleChunkVARI" unserialization. --- UndertaleModLib/UndertaleChunks.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/UndertaleModLib/UndertaleChunks.cs b/UndertaleModLib/UndertaleChunks.cs index 1463d3406..1e6c39019 100644 --- a/UndertaleModLib/UndertaleChunks.cs +++ b/UndertaleModLib/UndertaleChunks.cs @@ -651,6 +651,7 @@ internal override void UnserializeChunk(UndertaleReader reader) else varLength = 12; List.Clear(); + List.Capacity = (int)(Length / varLength); while (reader.Position + varLength <= startPosition + Length) List.Add(reader.ReadUndertaleObject()); }