From: Maciej S. <m.s...@gm...> - 2006-07-28 23:47:48
|
So we use List<T>s (or at least IList<T>s) all over the place, where we are implicitly ignoring the occurence of duplicates. Should we maybe move this all to Set<T>s? I've added a lot of stuff to the Set<T> class, and have tested it thoroughly. Maybe we should move to ISet<T>s instead, in case we ever feel like implementing a Set<T>-like class in another way. Either way, though, it seems like it's a bad idea to use IList<T>s where we really mean "IList<T>, but with no duplicates". I guess the major catch is that since Set<T> is implemented on top of a dictionary, and not a list, we lose the ordered property. I don't know if any code actually depended on this. Set<T> does implement ICollection (among other things), so it should be pretty easy to work with, but I thought I'd check with you guys in case there is a good reason to use IList<T> in some place (mostly I'm talking about passing around IList<T>s of IPictureInfos for filtering purposes)... |