ISet<T>.unsafe constructor

ISet<T>.unsafe(
  1. Set<T> set, {
  2. required ConfigSet config,
})

Unsafe constructor. Use this at your own peril.

This constructor is fast, since it makes no defensive copies of the set. However, you should only use this with a new set you've created yourself, when you are sure no external copies exist. If the original set is modified, it will break the ISet and any other derived sets in unpredictable ways.

Also, if config is ConfigSet.sort true, it assumes you will pass it a sorted set. It will not sort the set for you. In this case, if set is not sorted, it will break the ISet and any other derived sets in unpredictable ways.

Implementation

factory ISet.unsafe(Set<T> set, {required ConfigSet config}) =>
    ISetImpl.unsafe(set, config: config);