Use TryGetValue to speed it up a little

This commit is contained in:
de4dot 2012-01-27 05:54:23 +01:00
parent 50e7d28ddf
commit 9e1412a6ae

View File

@ -81,8 +81,9 @@ namespace de4dot.code.renamer {
public virtual TypeNames merge(TypeNames other) {
foreach (var pair in other.typeNames) {
if (typeNames.ContainsKey(pair.Key))
typeNames[pair.Key].merge(pair.Value);
NameCreator nc;
if (typeNames.TryGetValue(pair.Key, out nc))
nc.merge(pair.Value);
else
typeNames[pair.Key] = pair.Value.clone();
}