This commit is contained in:
John Rommel Estropia
2015-08-28 08:09:06 +09:00
parent d5e769be6c
commit 21a524d725
13 changed files with 240 additions and 251 deletions

View File

@@ -166,12 +166,10 @@ public struct MigrationChain: NilLiteralConvertible, StringLiteralConvertible, D
var valid = true
for version in elements {
if let lastVersion = lastVersion {
if let _ = versionTree.updateValue(version, forKey: lastVersion) {
if let lastVersion = lastVersion,
let _ = versionTree.updateValue(version, forKey: lastVersion) {
valid = false
}
}
lastVersion = version
}
@@ -203,11 +201,11 @@ public struct MigrationChain: NilLiteralConvertible, StringLiteralConvertible, D
internal func nextVersionFrom(version: String) -> String? {
if let nextVersion = self.versionTree[version] where nextVersion != version {
guard let nextVersion = self.versionTree[version] where nextVersion != version else {
return nextVersion
return nil
}
return nil
return nextVersion
}