private static MergeProductions ( Production>.Dictionary |
||
results | Production>.Dictionary | |
toAdd | IEnumerable |
|
return | void |
private static void MergeProductions(Dictionary<Production, Production> results, IEnumerable<Production> toAdd) {
foreach (var newProduction in toAdd) {
Production existingProduction;
if (results.TryGetValue(newProduction, out existingProduction)) {
existingProduction.Weight += newProduction.Weight;
} else {
results[newProduction] = newProduction;
}
}
}