unlockLazy property

Set<T> unlockLazy

Unlocks the set, returning a safe, modifiable (mutable) Set. Using this is very fast at first, since it makes no copies of the ISet items. However, if and only if you use a method that mutates the set, like add, it will unlock internally (make a copy of all ISet items). This is transparent to you, and will happen at most only once. In other words, it will unlock the ISet, lazily, only if necessary. If you never mutate the set, it will be very fast to lock this set back into an ISet.

See also: ModifiableSetFromISet

Implementation

Set<T> get unlockLazy => ModifiableSetFromISet(this);