Set.add should return a boolean if the item was added #6548
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-duplicate
Closed in favor of an existing report
library-collection
type-enhancement
A request for a change that isn't a bug
It would be nice to add a method to the set and also check if it is there at the same time. C# HashSet.add works like this:
http://msdn.microsoft.com/en-us/library/bb353005.aspx
This saves an extra lookup. Otherwise you need to do "if (set.contains(key)) { doSomething(); } else { set.add(key); }"
We already have "set.remove" which returns a bool :)
The text was updated successfully, but these errors were encountered: