diff --git a/DAO.podspec b/DAO.podspec index 8368fa4..949ef35 100644 --- a/DAO.podspec +++ b/DAO.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'DAO' - s.version = '1.4.0' + s.version = '1.4.1' s.summary = 'DAO Library' s.description = 'Library provides easy way to cache entities.' s.homepage = 'https://github.com/RedMadRobot/DAO' diff --git a/DAO/Classes/Core/Entity.swift b/DAO/Classes/Core/Entity.swift index d199fa0..37dba02 100644 --- a/DAO/Classes/Core/Entity.swift +++ b/DAO/Classes/Core/Entity.swift @@ -36,7 +36,7 @@ open class Entity: Hashable { } - /// Function to redefine it in children for proper equality. + /// Redefine this function in child class for proper equality. /// /// - Parameter other: entity compare with. /// - Returns: result of comparison. diff --git a/DAO/Classes/CoreDataDAO/DAO/CoreDataDAO.swift b/DAO/Classes/CoreDataDAO/DAO/CoreDataDAO.swift index b8a051c..5b62274 100644 --- a/DAO/Classes/CoreDataDAO/DAO/CoreDataDAO.swift +++ b/DAO/Classes/CoreDataDAO/DAO/CoreDataDAO.swift @@ -351,7 +351,7 @@ open class CoreDataDAO : DAO { inContext context: NSManagedObjectContext) -> Bool { let existingEntries = fetchEntries(entryId, inContext: context) - return existingEntries.count > 0 + return !existingEntries.isEmpty } diff --git a/DAO/Classes/RealmDAO/Translator/RealmTranslator.swift b/DAO/Classes/RealmDAO/Translator/RealmTranslator.swift index 0ede4aa..81c2efa 100644 --- a/DAO/Classes/RealmDAO/Translator/RealmTranslator.swift +++ b/DAO/Classes/RealmDAO/Translator/RealmTranslator.swift @@ -37,10 +37,7 @@ open class RealmTranslator { fromEntities .map { entity -> (RealmModel, Model) in - - let entry = entries - .filter { $0.entryId == entity.entityId } - .first + let entry = entries.first { $0.entryId == entity.entityId } if let entry = entry { return (entry, entity) diff --git a/Example/DAO.xcodeproj/project.pbxproj b/Example/DAO.xcodeproj/project.pbxproj index d9f0e49..4266cf4 100644 --- a/Example/DAO.xcodeproj/project.pbxproj +++ b/Example/DAO.xcodeproj/project.pbxproj @@ -746,7 +746,7 @@ INFOPLIST_FILE = DAO/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.4.0; + MARKETING_VERSION = 1.4.1; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -763,7 +763,7 @@ INFOPLIST_FILE = DAO/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 1.4.0; + MARKETING_VERSION = 1.4.1; MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)";