Skip to content

Commit b02d093

Browse files
committed
rename generic parameters
1 parent e2bf1f7 commit b02d093

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Sources/CacheContainer.swift

+11-11
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,35 @@ public final class CacheContainer: Sendable {
4747
}
4848
}
4949

50-
final class ThreadSafeDictionary<V: Hashable & Sendable, T: Sendable>: Collection, @unchecked Sendable {
51-
private var dictionary: [V : T]
50+
final class ThreadSafeDictionary<Key: Hashable & Sendable, Value: Sendable>: Collection, @unchecked Sendable {
51+
private var dictionary: [Key : Value]
5252
private let concurrentQueue = DispatchQueue(label: "Dictionary Barrier Queue", attributes: .concurrent)
5353

54-
var keys: Dictionary<V, T>.Keys {
54+
var keys: Dictionary<Key, Value>.Keys {
5555
concurrentQueue.sync { dictionary.keys }
5656
}
5757

58-
var values: Dictionary<V, T>.Values {
58+
var values: Dictionary<Key, Value>.Values {
5959
concurrentQueue.sync { dictionary.values }
6060
}
6161

62-
var startIndex: Dictionary<V, T>.Index {
62+
var startIndex: Dictionary<Key, Value>.Index {
6363
concurrentQueue.sync { dictionary.startIndex }
6464
}
6565

66-
var endIndex: Dictionary<V, T>.Index {
66+
var endIndex: Dictionary<Key, Value>.Index {
6767
concurrentQueue.sync { dictionary.endIndex }
6868
}
6969

70-
init(dictionary: [V : T] = [:]) {
70+
init(dictionary: [Key : Value] = [:]) {
7171
self.dictionary = dictionary
7272
}
7373

74-
func index(after i: Dictionary<V, T>.Index) -> Dictionary<V, T>.Index {
74+
func index(after i: Dictionary<Key, Value>.Index) -> Dictionary<Key, Value>.Index {
7575
concurrentQueue.sync { dictionary.index(after: i) }
7676
}
7777

78-
subscript(key: V) -> T? {
78+
subscript(key: Key) -> Value? {
7979
set(newValue) {
8080
concurrentQueue.async(flags: .barrier) { [weak self] in
8181
self?.dictionary[key] = newValue
@@ -86,11 +86,11 @@ final class ThreadSafeDictionary<V: Hashable & Sendable, T: Sendable>: Collectio
8686
}
8787
}
8888

89-
subscript(index: Dictionary<V, T>.Index) -> Dictionary<V, T>.Element {
89+
subscript(index: Dictionary<Key, Value>.Index) -> Dictionary<Key, Value>.Element {
9090
concurrentQueue.sync { dictionary[index] }
9191
}
9292

93-
func removeValue(forKey key: V) {
93+
func removeValue(forKey key: Key) {
9494
concurrentQueue.async(flags: .barrier) { [weak self] in
9595
self?.dictionary.removeValue(forKey: key)
9696
}

0 commit comments

Comments
 (0)