SPARK-2476 OB _get_legs KeyNotFoundException
This commit is contained in:
1 parent
e98d18a5aa
commit
5722fcffc3
1 file changed
+3
-6
@@ -322,12 +322,9 @@ namespace mbts.spark {
|
||||
}
|
||||
|
||||
static IEnumerable<LegSpreaderParamsTuple> _get_legs(Security synthetic, ExecutionStrategyImmutable strategy) {
|
||||
try {
|
||||
var results = synthetic.Synthetic.Legs
|
||||
.Select(l => new LegSpreaderParamsTuple(l, strategy.LegParamsMap[l.Security.Id].Clone())).ToList();
|
||||
return results;
|
||||
} catch (KeyNotFoundException) {
|
||||
return Enumerable.Empty<LegSpreaderParamsTuple>();
|
||||
foreach (var l in synthetic.Synthetic.Legs) {
|
||||
if (strategy.LegParamsMap.TryGetValue(l.Security.Id, out var p))
|
||||
yield return new LegSpreaderParamsTuple(l, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user