SplitScript reference / Set / clear

Set.clear

Method

Set<T>.clear() -> None where T: Equatable

Removes every stored value while retaining the set itself.

Later insertions reuse the same logical set value. Clearing invalidates active iteration of this set.

Effects: allocates, mutates the receiver

Runtime behavior: available everywhere; synchronous

Examples

Reset a route

let visited = Set.new<String>()
visited.clear()