From e98caf2c50884ef01d7854f6b9d766386f572b8c Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Mon, 22 Apr 2013 11:33:07 +0200 Subject: [PATCH] Remove before adding to mix map. Because it would be *crazy* to want to overwrite an existing map entry, and it's always better to do moar map lookups. --- spine-csharp/src/AnimationStateData.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spine-csharp/src/AnimationStateData.cs b/spine-csharp/src/AnimationStateData.cs index c1b91f5ca..571e9fc08 100644 --- a/spine-csharp/src/AnimationStateData.cs +++ b/spine-csharp/src/AnimationStateData.cs @@ -46,7 +46,9 @@ namespace Spine { public void SetMix (Animation from, Animation to, float duration) { if (from == null) throw new ArgumentNullException("from cannot be null."); if (to == null) throw new ArgumentNullException("to cannot be null."); - animationToMixTime.Add(new KeyValuePair(from, to), duration); + KeyValuePair key = new KeyValuePair(from, to); + animationToMixTime.Remove(key); + animationToMixTime.Add(key, duration); } public float GetMix (Animation from, Animation to) {