Fixed issue with many:1 encoded string mapping.

This commit is contained in:
Greg Edwards
2014-08-05 02:10:03 -04:00
parent 599cfcb877
commit 7c7540d1c0

View File

@@ -156,14 +156,15 @@ namespace PkmnFoundations.Support
{
if (m_lookup_reverse == null)
{
lock (m_lookup_reverse)
{
Dictionary<char, ushort> reverse = new Dictionary<char, ushort>(Generation4TextLookupTable.Count);
foreach (KeyValuePair<ushort, char> pair in Generation4TextLookupTable)
reverse.Add(pair.Value, pair.Key);
Dictionary<char, ushort> reverse = new Dictionary<char, ushort>(Generation4TextLookupTable.Count);
m_lookup_reverse = reverse;
foreach (KeyValuePair<ushort, char> pair in Generation4TextLookupTable)
{
if (!reverse.ContainsKey(pair.Value))
reverse.Add(pair.Value, pair.Key);
}
m_lookup_reverse = reverse;
}
return m_lookup_reverse;
}