Change RevertableDesigns Dictionary to ConcurrentDictionary

This commit is contained in:
Stanley Dimant 2022-07-27 10:00:24 +02:00
parent 5e4b225081
commit 9ee0ee902b

View file

@ -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<string, CharacterSave> Saves = new();
public readonly ConcurrentDictionary<string, CharacterSave> 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;
}
}