How big is this dictionary?.... unless it's got tens of thousands of entries I can't imagine it having the slightest impact on performance. I would expect the performance of this to be much better than looping through mulitple lists/dictionaries. Also you eliminate the Remove calls, which are probably the slowest part (I haven't got any evidence for that statement!).
I use this sort of thing all over the place without any issues at all, even in class properties to feed data into grid cells.
Contrary to what 'common myth' has to say (and the guys down the 'pub'), LINQ is just a standard part of current .NET coding.
Nothing special is required, and the namespaces are already included by default in the standard templates for Projects.
Nick and Robert have pointed you at some LINQ based solutions to your problem, some more eloquent than others (even if they do contain Lambda clauses). Robert's first one looks a bit neater and nicer, and is almost what Nick suggested.
We should be reaching for LINQ for all collection based processing - that's what it was designed for - COLLECTIONS.
That's because ToList() is an extension method, defined in the System.Linq.Enumerable class of System.Core.dll. For this reason, you must make sure you have a reference to System.Core and also include a USING System.Linq in your prg file.
But for Nick: unfortunately I'm not able to move your code to X#, and the MS documentation says that there is not ToDictionary() method without any parameters - the X# compiler says the same thing.
I have tried this code: