Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions Sources/CacheStore/Stores/CacheStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,9 @@ public extension CacheStore {

extension CacheStore {
func isCacheEqual(to updatedStore: CacheStore<Key>) -> Bool {
#if DEBUG
let cacheStoreCount = cache.count
#else
lock.lock()
let cacheStoreCount = cache.count
lock.unlock()
#endif
lock.lock()
let cacheStoreCount = cache.count
lock.unlock()

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

Expand All @@ -233,11 +229,6 @@ extension CacheStore {
}

func isValueEqual<Value>(toUpdatedValue updatedValue: Value, forKey key: Key) -> Bool {
#if !DEBUG
lock.lock()
defer { lock.unlock() }
#endif

guard let storeValue: Value = get(key) else {
return false
}
Expand Down