これは宿題ではありません;)A)次のコード(TODOと〜TODOの間)を最適化し、B)[P]Linqに変換する必要があります。より良い読みやすさが望まれます。A)とB)に別々に答えを提供することは理にかなっているかもしれません。ありがとう!
lock (Status.LockObj)
{
// TODO: find a better way to merge these dictionaries
foreach (KeyValuePair<Guid, Message> sInstance in newSInstanceDictionary)
{
this.sInstanceDictionary.Add(sInstance.Key, sInstance.Value);
}
foreach (KeyValuePair<Guid, Message> sOperation in newSOperationDictionary)
{
this.sOperationDictionary.Add(sOperation.Key, sOperation.Value);
}
// ~TODO
}
PS私の他の賞金稼ぎの質問をチェックしてください。