Swift 4 support

This commit is contained in:
John Estropia
2017-06-09 11:25:28 +09:00
parent f618617053
commit 6e01a58c85
17 changed files with 116 additions and 69 deletions

View File

@@ -117,8 +117,9 @@ public struct MigrationChain: ExpressibleByNilLiteral, ExpressibleByStringLitera
var isValid = true
var versionTree = [String: String]()
elements.forEach { (sourceVersion, destinationVersion) in
elements.forEach {
let (sourceVersion, destinationVersion) = $0
guard let _ = versionTree.updateValue(destinationVersion, forKey: sourceVersion) else {
return
@@ -130,8 +131,8 @@ public struct MigrationChain: ExpressibleByNilLiteral, ExpressibleByStringLitera
}
let leafVersions = Set(
elements
.filter { versionTree[$1] == nil }
.map { $1 }
.filter { versionTree[$0.1] == nil }
.map { $0.1 }
)
let isVersionAmbiguous = { (start: String) -> Bool in