Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tonyarnold/4f313d844ab5360e093ee9c96e8a6338 to your computer and use it in GitHub Desktop.
Save tonyarnold/4f313d844ab5360e093ee9c96e8a6338 to your computer and use it in GitHub Desktop.
So wrong, so, so wrong
extension RangeReplaceableCollectionType where Index : Comparable {
mutating func removeAtIndexes<S : SequenceType where S.Generator.Element == Index>(indexes: S) -> [Self.Generator.Element] {
return indexes.sort().lazy.reverse().map { removeAtIndex($0) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment