From 9ee0ee902b40fc2050ce742494ed3e615af0abc8 Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Wed, 27 Jul 2022 10:00:24 +0200 Subject: [PATCH] Change RevertableDesigns Dictionary to ConcurrentDictionary --- Glamourer/Designs/RevertableDesigns.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Glamourer/Designs/RevertableDesigns.cs b/Glamourer/Designs/RevertableDesigns.cs index e9b7505..14eab86 100644 --- a/Glamourer/Designs/RevertableDesigns.cs +++ b/Glamourer/Designs/RevertableDesigns.cs @@ -1,11 +1,12 @@ -using System.Collections.Generic; +using System.Collections.Concurrent; +using System.Collections.Generic; using Dalamud.Game.ClientState.Objects.Types; namespace Glamourer.Designs { public class RevertableDesigns { - public readonly Dictionary Saves = new(); + public readonly ConcurrentDictionary Saves = new(); public bool Add(Character actor) { @@ -24,7 +25,7 @@ namespace Glamourer.Designs if (!Saves.ContainsKey(actorName)) return false; - Saves.Remove(actorName); + Saves.Remove(actorName, out _); return true; } @@ -34,7 +35,7 @@ namespace Glamourer.Designs return false; save.Apply(actor); - Saves.Remove(actor.Name.ToString()); + Saves.Remove(actor.Name.ToString(), out _); return true; } }