From 74bde133bb9fc3a77cbca49d9c1099dd63749421 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Thu, 29 Aug 2024 18:09:10 +0100 Subject: [PATCH] Simplify model cache setting --- project/code/TMV/ModelLoader.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/project/code/TMV/ModelLoader.cs b/project/code/TMV/ModelLoader.cs index 5b6eafd..135900c 100644 --- a/project/code/TMV/ModelLoader.cs +++ b/project/code/TMV/ModelLoader.cs @@ -33,15 +33,7 @@ public class ModelLoader // We don't care if this is null actually, we'll still cache that it's null lol var model = LoadModel(_pathManager, ref campaignName, modelName); - var key = (campaignName, modelName); - if (_cache.ContainsKey(key)) - { - _cache[key] = model; - } - else - { - _cache.TryAdd(key, model); - } + _cache[(campaignName, modelName)] = model; return model == null ? model : model.Duplicate() as MeshInstance3D; }