Преглед на файлове

Address PR comments (typo, variable name)

Deniz Cengiz преди 1 година
родител
ревизия
1103f16f38
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      Model/JSONImporter.swift

+ 3 - 3
Model/JSONImporter.swift

@@ -60,13 +60,13 @@ class JSONImporter {
         return Set(allReadings.compactMap(\.date))
         return Set(allReadings.compactMap(\.date))
     }
     }
 
 
-    /// Retrieves the set of timestamps for all pump evets currently stored in CoreData.
+    /// Retrieves the set of timestamps for all pump events currently stored in CoreData.
     ///
     ///
     /// - Parameters: the start and end dates to fetch pump events, inclusive
     /// - Parameters: the start and end dates to fetch pump events, inclusive
     /// - Returns: A set of dates corresponding to existing pump events.
     /// - Returns: A set of dates corresponding to existing pump events.
     /// - Throws: An error if the fetch operation fails.
     /// - Throws: An error if the fetch operation fails.
     private func fetchPumpTimestamps(start: Date, end: Date) async throws -> Set<Date> {
     private func fetchPumpTimestamps(start: Date, end: Date) async throws -> Set<Date> {
-        let allReadings = try await coreDataStack.fetchEntitiesAsync(
+        let allPumpEvents = try await coreDataStack.fetchEntitiesAsync(
             ofType: PumpEventStored.self,
             ofType: PumpEventStored.self,
             onContext: context,
             onContext: context,
             predicate: .predicateForTimestampBetween(start: start, end: end),
             predicate: .predicateForTimestampBetween(start: start, end: end),
@@ -74,7 +74,7 @@ class JSONImporter {
             ascending: false
             ascending: false
         ) as? [PumpEventStored] ?? []
         ) as? [PumpEventStored] ?? []
 
 
-        return Set(allReadings.compactMap(\.timestamp))
+        return Set(allPumpEvents.compactMap(\.timestamp))
     }
     }
 
 
     /// Retrieves the set of timestamps for all carb entries currently stored in CoreData.
     /// Retrieves the set of timestamps for all carb entries currently stored in CoreData.