mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-28 01:44:37 -05:00
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
This commit is contained in:
@@ -13,7 +13,7 @@ public partial class Util
|
||||
private const string TranslationSplitter = " = ";
|
||||
private static Assembly thisAssembly = typeof(Util).GetTypeInfo().Assembly;
|
||||
private static string[] manifestResourceNames = thisAssembly.GetManifestResourceNames();
|
||||
private static ConcurrentDictionary<string, string[]> stringListCache = new ConcurrentDictionary<string, string[]>();
|
||||
private static Dictionary<string, string[]> stringListCache = new Dictionary<string, string[]>();
|
||||
|
||||
|
||||
#region String Lists
|
||||
@@ -86,7 +86,7 @@ public static string[] GetStringList(string f)
|
||||
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}");
|
||||
|
||||
Reference in New Issue
Block a user