Some polish code fixes

This commit is contained in:
Ivan Vavilov 2020-04-20 10:42:01 +03:00
parent af6787d98e
commit d1e9360390
5 changed files with 6 additions and 9 deletions

View File

@ -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'

View File

@ -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.

View File

@ -351,7 +351,7 @@ open class CoreDataDAO<Model: Entity, CDModel: NSManagedObject> : DAO<Model> {
inContext context: NSManagedObjectContext) -> Bool {
let existingEntries = fetchEntries(entryId, inContext: context)
return existingEntries.count > 0
return !existingEntries.isEmpty
}

View File

@ -37,10 +37,7 @@ open class RealmTranslator<Model: Entity, RealmModel: RLMEntry> {
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)

View File

@ -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)";