Jelajahi Sumber

Use `isExpired` instead of directly checking `expiration.isPast`

Iggy Drougge 3 tahun lalu
induk
melakukan
8bbac9b7aa
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      Sources/Cache/MemoryStorage.swift

+ 3 - 3
Sources/Cache/MemoryStorage.swift

@@ -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)
                 }
@@ -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)
@@ -278,7 +278,7 @@ extension MemoryStorage {
             }
         }
         
-        var expired: Bool {
+        var isExpired: Bool {
             return estimatedExpiration.isPast
         }
     }