Skip to content

Commit

Permalink
Removed unnecessary predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
Reed Es committed Mar 7, 2023
1 parent 329c031 commit 0631afa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Sources/Entities/AppSetting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public extension AppSetting {
static func getOrCreate(_ context: NSManagedObjectContext,
onUpdate: (Bool, AppSetting) -> Void = { _, _ in }) throws -> AppSetting
{
// obtain the earliest appSetting in case dupes exist
let predicate = NSPredicate(format: "createdAt != nil")
if let existing: AppSetting = try context.firstFetcher(predicate: predicate, sortDescriptors: earliestSort) {
if let existing: AppSetting = try context.firstFetcher(sortDescriptors: earliestSort) {
onUpdate(true, existing)
return existing
} else {
Expand Down

0 comments on commit 0631afa

Please sign in to comment.