Add ToDictionarySkipDuplicates - fix duplicate key.#395
Add ToDictionarySkipDuplicates - fix duplicate key.#395KirillOsenkov merged 1 commit intogluck:masterfrom
ToDictionarySkipDuplicates - fix duplicate key.#395Conversation
ToDictionarySkipDuplicatesToDictionarySkipDuplicates - fix duplicate key.
|
Hey @warappa could you take a look if skip the duplicate key is a valid solution. Thanks. |
|
I think this is fine! 👍 |
|
The only question that arises is, if the deep-first-search is then the correct one to do or if in such a case a "top-first-search" would be better. You woukd have to test if the newer System.Text.Json is detected or the older one. EDIT: But maybe this is not of an issue here, as we compare the |
Actually is not a Like creating a copy of the dll and repack the source and the copy. This trigger the same key in the dictionary. #394 |
| var dict = new Dictionary<string, AssemblyDefinition>(); | ||
| foreach (var assembly in assemblies) | ||
| { | ||
| if (!dict.ContainsKey(assembly.Name.Name)) |
There was a problem hiding this comment.
assembly.Name.Name is repeated three times, it's good to extract a local variable and reuse it
There was a problem hiding this comment.
Make sense, oh you already changed to the key. Nice!
This pr is related to the issue: #394