Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mathonsunday/b15b91640e77536f7658ed8e58b12077 to your computer and use it in GitHub Desktop.
Save mathonsunday/b15b91640e77536f7658ed8e58b12077 to your computer and use it in GitHub Desktop.
@discardableResult
public mutating func pop() -> Value? {
defer {
head = head?.next
if isEmpty {
tail = nil
}
}
return head?.value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment