world regen clears all chunks

This commit is contained in:
2024-09-07 04:05:50 +10:00
parent c80e456d3e
commit ee54e011a1
4 changed files with 23 additions and 5 deletions

View File

@ -70,6 +70,12 @@ public class ConcurrentDictionary<V: Hashable, T>: Collection {
}
}
public func removeAll(keepingCapacity keep: Bool = false) {
self.locked {
self.inner.removeAll(keepingCapacity: keep)
}
}
fileprivate func locked<X>(_ perform: () -> X) -> X {
self.lock.lock()
defer {