Skip to content

Instantly share code, notes, and snippets.

@hikarin522
Last active March 2, 2018 04:55
Show Gist options
  • Save hikarin522/cc0090384303ef9f514a72820ee73040 to your computer and use it in GitHub Desktop.
Save hikarin522/cc0090384303ef9f514a72820ee73040 to your computer and use it in GitHub Desktop.
func ==<Element: Equatable>(lhs: [Element]?, rhs: [Element]?) -> Bool {
return lhs.map { l in rhs.map { l == $0 } ?? false }
?? rhs.map { r in lhs.map { $0 == r } ?? false }
?? true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment