Skip to content

Instantly share code, notes, and snippets.

@alemar11
Created September 1, 2017 11:00
Show Gist options
  • Save alemar11/b4864389fab0daad5089ba4a4f0a0313 to your computer and use it in GitHub Desktop.
Save alemar11/b4864389fab0daad5089ba4a4f0a0313 to your computer and use it in GitHub Desktop.
Array+Equatable
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