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

@@ -128,8 +128,8 @@ Asset::LoadResult Prefab::loadAsset()
}
// Allocate memory for objects
ObjectsIds.EnsureCapacity(objectsCount * 2);
ObjectsDataCache.EnsureCapacity(objectsCount * 3);
ObjectsIds.EnsureCapacity(objectsCount);
ObjectsDataCache.EnsureCapacity(objectsCount);
// Find serialized object ids (actors and scripts), they are used later for IDs mapping on prefab spawning via PrefabManager
const auto& data = *Data;
@@ -157,7 +157,7 @@ Asset::LoadResult Prefab::loadAsset()
{
if (prefabId == _id)
{
LOG(Error, "Circural reference in prefab.");
LOG(Error, "Circular reference in prefab.");
return LoadResult::InvalidData;
}