Skip to content

Commit

Permalink
Use isExpired instead of directly checking expiration.isPast
Browse files Browse the repository at this point in the history
  • Loading branch information
idrougge committed Jun 23, 2022
1 parent 03d48c1 commit 8bbac9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Cache/MemoryStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public enum MemoryStorage {
keys.remove(key)
continue
}
if object.estimatedExpiration.isPast {
if object.isExpired {
storage.removeObject(forKey: nsKey)
keys.remove(key)
}
Expand Down Expand Up @@ -146,7 +146,7 @@ public enum MemoryStorage {
guard let object = storage.object(forKey: key as NSString) else {
return nil
}
if object.expired {
if object.isExpired {
return nil
}
object.extendExpiration(extendingExpiration)
Expand Down Expand Up @@ -278,7 +278,7 @@ extension MemoryStorage {
}
}

var expired: Bool {
var isExpired: Bool {
return estimatedExpiration.isPast
}
}
Expand Down

0 comments on commit 8bbac9b

Please sign in to comment.