Skip to content

Instantly share code, notes, and snippets.

@adamnemecek
Created August 7, 2021 02:56
Show Gist options
  • Save adamnemecek/786fb7a6620e032655b2c98f300d473e to your computer and use it in GitHub Desktop.
Save adamnemecek/786fb7a6620e032655b2c98f300d473e to your computer and use it in GitHub Desktop.
struct User : Equatable {
let id: UInt
let selected: Bool
}
var z = (0...10).map { User(id: $0, selected: $0 == 3 || $0 == 6 || $0 == 10) }
var q = (0...10).map { User(id: $0, selected: $0 == 3 || $0 == 6 || $0 == 10) }
z.gather(at: 0) { $0.selected }
z.gather(at: 5) { $0.selected }
q.gather(at: 5) { $0.selected }
print(z == q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment