From ea0705e7e418b4e2154cfda84c8485f5e0593d6c Mon Sep 17 00:00:00 2001 From: John Colvin Date: Sat, 2 Apr 2022 12:42:33 -0400 Subject: [PATCH] fix: Avoid dupl keys when stripping exch from SecurityExpiration --- .../spark/Analytics/Misc/VolSurfaceUtilityFunctions.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/spark/Analytics/Misc/VolSurfaceUtilityFunctions.cs b/src/client/spark/Analytics/Misc/VolSurfaceUtilityFunctions.cs index 8234e150f..c4467c1d5 100644 --- a/src/client/spark/Analytics/Misc/VolSurfaceUtilityFunctions.cs +++ b/src/client/spark/Analytics/Misc/VolSurfaceUtilityFunctions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -734,8 +734,10 @@ namespace mbts.analytics { IDictionary exp_params_map, IDictionary future_driver_price_map) { IDictionary rv = new Dictionary(); - exp_params_map = exp_params_map.ToDictionary(kv => kv.Key.unset_exchange(), kv => kv.Value); - future_driver_price_map = future_driver_price_map.ToDictionary(kv => kv.Key.unset_exchange(), kv => kv.Value); + exp_params_map = exp_params_map.ToDictionaryCrushed( + kv => kv.Key.unset_exchange(), kv => kv.Value); + future_driver_price_map = future_driver_price_map.ToDictionaryCrushed( + kv => kv.Key.unset_exchange(), kv => kv.Value); foreach (SecurityExpiration exp in future_exps) { /// This is not the best sln, but the calculations are /// exchange agnostic, the other data may not be.