Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let sortedKeys2 = Array(parents.keys).sorted { lhs, rhs in
- let lhsContent = parents[lhs] ?? []
- let rhsContent = parents[rhs] ?? []
- switch (lhsContent.isEmpty, rhsContent.isEmpty) {
- case (true, true):
- return rhs > lhs
- case (true, false):
- return true
- case (false, true):
- return false
- case (false, false):
- return rhsContent.contains(lhs)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement