Created
September 1, 2017 11:00
-
-
Save alemar11/b4864389fab0daad5089ba4a4f0a0313 to your computer and use it in GitHub Desktop.
Array+Equatable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public func ==<T: Equatable>(lhs: [T]?, rhs: [T]?) -> Bool { | |
switch (lhs,rhs) { | |
case (.some(let lhs), .some(let rhs)): | |
return lhs == rhs | |
case (.none, .none): | |
return true | |
default: | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment