don't warn about uncommitted changes when there aren't any

This commit is contained in:
John Rommel Estropia
2015-03-19 00:21:35 +09:00
parent bf41605da9
commit fddd42f52f
2 changed files with 3 additions and 3 deletions

View File

@@ -152,7 +152,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
self.transactionQueue.async { self.transactionQueue.async {
self.closure(transaction: self) self.closure(transaction: self)
if !self.isCommitted { if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.") HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.")
} }
@@ -164,7 +164,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
self.transactionQueue.sync { self.transactionQueue.sync {
self.closure(transaction: self) self.closure(transaction: self)
if !self.isCommitted { if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.") HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.")
} }

View File

@@ -103,7 +103,7 @@ public final class SynchronousDataTransaction: BaseDataTransaction {
self.transactionQueue.sync { self.transactionQueue.sync {
self.closure(transaction: self) self.closure(transaction: self)
if !self.isCommitted { if !self.isCommitted && self.hasChanges {
HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.") HardcoreData.log(.Warning, message: "The closure for the <\(self.dynamicType)> completed without being committed. All changes made within the transaction were discarded.")
} }