unlockLazy property

List<T> unlockLazy

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

See also: ModifiableListFromIList

Implementation

List<T> get unlockLazy => ModifiableListFromIList(this);