Skip to content

Commit ea2f22b

Browse files
authored
Merge pull request #13 from 0xOpenBytes/debug-flag-locking
Remove if debug for locking
2 parents fa32f3d + 0fb9997 commit ea2f22b

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

Sources/CacheStore/Stores/CacheStore.swift

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,9 @@ public extension CacheStore {
211211

212212
extension CacheStore {
213213
func isCacheEqual(to updatedStore: CacheStore<Key>) -> Bool {
214-
#if DEBUG
215-
let cacheStoreCount = cache.count
216-
#else
217-
lock.lock()
218-
let cacheStoreCount = cache.count
219-
lock.unlock()
220-
#endif
214+
lock.lock()
215+
let cacheStoreCount = cache.count
216+
lock.unlock()
221217

222218
guard cacheStoreCount == updatedStore.cache.count else { return false }
223219

@@ -233,11 +229,6 @@ extension CacheStore {
233229
}
234230

235231
func isValueEqual<Value>(toUpdatedValue updatedValue: Value, forKey key: Key) -> Bool {
236-
#if !DEBUG
237-
lock.lock()
238-
defer { lock.unlock() }
239-
#endif
240-
241232
guard let storeValue: Value = get(key) else {
242233
return false
243234
}

0 commit comments

Comments
 (0)