Open utterances-bot opened 2 years ago
Please note: While the iterator for HashSet
does appear to return the items in insertion order, this is merely an implementation detail, and not a guarantee, and the algorithm used might be changed in the future. The documentation for it specifically states that the "elements are in no particular order."
C# Tip: Use a SortedSet to avoid duplicates and sort items - Code4IT
Using the right data structure is crucial to build robust and efficient applications. So, why using an List or an HashSet to sort items (and remove duplicates) when you have a SortedSet?
https://www.code4it.dev/csharptips/sorted-set