Last active
May 8, 2019 00:46
-
-
Save RinniSwift/4d72b424fb9458b6bfaa1398c0b5ed4a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
func dequeue() -> T? { | |
// ... | |
// 1. | |
if !isEmpty() { | |
// 2. | |
let front = elements[bufferMaxSize - size] | |
elements[bufferMaxSize - size] = nil | |
size -= 1 | |
return front | |
} | |
// 3. | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment