From 513fa728d0f3aeb6dcfc39ffcf4e66672d1c8093 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Sun, 3 Nov 2013 12:16:07 +0100 Subject: [PATCH] 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. --- Source/Bind/Utilities.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Bind/Utilities.cs b/Source/Bind/Utilities.cs index c0f0fe5b..38335c92 100644 --- a/Source/Bind/Utilities.cs +++ b/Source/Bind/Utilities.cs @@ -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; } }