From 174969bc58edb30b096c00573c69de42a26916fc Mon Sep 17 00:00:00 2001 From: Tommaso Madonia Date: Tue, 27 Feb 2018 03:20:28 +0000 Subject: [PATCH] Fix CI --- SwiftLCS/SwiftLCS.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SwiftLCS/SwiftLCS.swift b/SwiftLCS/SwiftLCS.swift index 06784b1..b72ca1f 100644 --- a/SwiftLCS/SwiftLCS.swift +++ b/SwiftLCS/SwiftLCS.swift @@ -215,7 +215,9 @@ public extension Collection where Iterator.Element: Equatable { if self[index] == otherCollection[otherIndex] { lengths[(i &+ 1) &* columns &+ j &+ 1] = lengths[i &* columns &+ j] &+ 1 } else { - lengths[(i &+ 1) &* columns &+ j &+ 1] = Swift.max(lengths[(i &+ 1) &* columns &+ j], lengths[i &* columns &+ j &+ 1]) + let lhs = lengths[(i &+ 1) &* columns &+ j] + let rhs = lengths[i &* columns &+ j &+ 1] + lengths[(i &+ 1) &* columns &+ j &+ 1] = Swift.max(lhs, rhs) } otherIndex = otherCollection.index(after: otherIndex)