Replace in-place instead of removing/readding

There is no reason to remove and readd a Constant in order to replace
it in a ConstantCollection. We can actually do that in-place.
This commit is contained in:
Stefanos A. 2013-11-03 12:16:07 +01:00
parent 39b1f84fc8
commit 513fa728d0

View file

@ -228,8 +228,7 @@ namespace Bind
// keep the first one.
if (!String.IsNullOrEmpty(s.ConstantCollection[t.Name].Reference))
{
s.ConstantCollection.Remove(t.Name);
s.ConstantCollection.Add(t.Name, t);
s.ConstantCollection[t.Name] = t;
}
}