Is there a more optimal way to do the following -
int interactionScore = 0;
foreach (var completionResult in needs.Keys.Intersect(results.Keys))
{
interactionScore -= results[completionResult] * needs[completionResult];
}
both needs and results are small dictionaries (around 2 - 10 entries each) but the number of times I run this loop is very high and it is hurting my performance, so I was wondering if there is a more efficient way to achieve similar results (multiplying only entries which exist in both dictionaries).