Skip to content

Commit

Permalink
Merge branch 'keys-exist'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Sources/Bodega/DiskStorageEngine.swift
#	Sources/Bodega/ObjectStorage.swift
  • Loading branch information
mergesort committed Oct 20, 2023
2 parents b955bce + 342790d commit f0c152c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public protocol StorageEngine: Actor {
func removeAllData() async throws

func keyExists(_ key: CacheKey) async -> Bool
func keysExist(_ keys: [CacheKey]) async -> [CacheKey]
func keyCount() async -> Int
func allKeys() async -> [CacheKey]

Expand Down
2 changes: 1 addition & 1 deletion Sources/Bodega/StorageEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ extension StorageEngine {
public func keysExist(_ keys: [CacheKey]) async -> [CacheKey] {
let allKeys = await self.allKeys()
let keySet = Set(allKeys)
return keys.filter { keySet.contains($0) }
return keys.filter({ keySet.contains($0) })
}

/// Read the number of keys located in the ``StorageEngine``.
Expand Down

0 comments on commit f0c152c

Please sign in to comment.