From 81e87c1a152e0de3a2eb55500e06fa33979eb239 Mon Sep 17 00:00:00 2001 From: Evan Dixon Date: Wed, 1 Nov 2017 21:42:12 -0500 Subject: [PATCH] Change the concurrent dictionary to a dictionary It'd be nice to be thread-safe, but I don't really expect multithreaded applications to be calling this method a lot, and I'd imagine the concurrent version has more overhead --- PKHeX.Core/Util/DataUtil.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Util/DataUtil.cs b/PKHeX.Core/Util/DataUtil.cs index 4b754d672..23cc50bdc 100644 --- a/PKHeX.Core/Util/DataUtil.cs +++ b/PKHeX.Core/Util/DataUtil.cs @@ -13,7 +13,7 @@ namespace PKHeX.Core private const string TranslationSplitter = " = "; private static Assembly thisAssembly = typeof(Util).GetTypeInfo().Assembly; private static string[] manifestResourceNames = thisAssembly.GetManifestResourceNames(); - private static ConcurrentDictionary stringListCache = new ConcurrentDictionary(); + private static Dictionary stringListCache = new Dictionary(); #region String Lists @@ -86,7 +86,7 @@ namespace PKHeX.Core string[] rawlist = txt.Split('\n'); for (int i = 0; i < rawlist.Length; i++) rawlist[i] = rawlist[i].Trim(); - stringListCache[f] = rawlist; + stringListCache.Add(f, rawlist); return rawlist; } public static string[] GetStringList(string f, string l, string type = "text") => GetStringList($"{type}_{f}_{l}");