Created
May 23, 2019 22:21
-
-
Save jeremycochoy/75dbc0d3395c467855cba1229c53b85a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Insert a new track | |
mutating func insert(element: T) { | |
if let c = cursor {leftList.append(c)} | |
cursor = element | |
} | |
/// Remove the current pointed track | |
mutating func remove() { | |
guard let _ = cursor else {return} | |
if leftList.isNotEmpty { | |
cursor = leftList.popLast() | |
} else { | |
cursor = rightList.popLast() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment