Files
morevsavva c1eba2b850 Supported actions scope_id
commit_hash:46ae2390fc145524e104396aac11fc236b5eebe2
2024-10-08 12:05:07 +03:00

33 lines
558 B
Swift

import LayoutKit
import VGSL
final class IdToPath {
private var idToPath = [UIElementPath: UIElementPath]()
private let lock = AllocatedUnfairLock()
subscript(id: UIElementPath) -> UIElementPath? {
get {
lock.withLock {
idToPath[id]
}
}
set {
lock.withLock {
idToPath[id] = newValue
}
}
}
func reset() {
lock.withLock {
idToPath.removeAll()
}
}
func reset(cardId: DivCardID) {
lock.withLock {
idToPath = idToPath.filter { $0.key.cardId != cardId }
}
}
}