Fixes dictionary uses (#7)

This commit is contained in:
Kamron Batman 2018-11-02 08:16:42 -07:00 committed by GitHub
parent d4a52344f2
commit 916d404c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
161 changed files with 1211 additions and 1722 deletions

View file

@ -8,15 +8,15 @@ namespace Server.Misc
/**
* This file requires to be saved in a Unicode
* compatible format.
*
*
* Warning: if you change String.Format methods,
* please note that the following character
* is suggested before any left-to-right text
* in order to prevent undesired formatting
* resulting from mixing LR and RL text:
*
*
* Use this one if you need to force RL:
*
*
* If you do not see the above chars, please
* enable showing of unicode control chars
**/
@ -199,17 +199,17 @@ namespace Server.Misc
string lang = mob?.Language;
if (lang != null)
{
lang = lang.ToUpper();
if (lang == null)
continue;
if (!ht.ContainsKey(lang))
ht[lang] = new InternationalCodeCounter(lang);
else
ht[lang].Increase();
lang = lang.ToUpper();
break;
}
if (ht.TryGetValue(lang, out InternationalCodeCounter codes))
codes.Increase();
else
ht[lang] = new InternationalCodeCounter(lang);
break;
}
else
foreach (Mobile mob in World.Mobiles.Values)
@ -217,15 +217,15 @@ namespace Server.Misc
{
string lang = mob.Language;
if (lang != null)
{
lang = lang.ToUpper();
if (lang == null)
continue;
if (!ht.ContainsKey(lang))
ht[lang] = new InternationalCodeCounter(lang);
else
ht[lang].Increase();
}
lang = lang.ToUpper();
if (ht.TryGetValue(lang, out InternationalCodeCounter codes))
codes.Increase();
else
ht[lang] = new InternationalCodeCounter(lang);
}
writer.WriteLine(
@ -350,4 +350,4 @@ namespace Server.Misc
}
}
}
}
}