Skip to content

Commit 6e2f5c1

Browse files
Kelvin LauKelvin Lau
authored andcommitted
Fixes README file for Swift3.
1 parent 6f14d9e commit 6e2f5c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Bounded Priority Queue/README.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class BoundedPriorityQueue<T: Comparable> {
3535
private typealias Node = LinkedListNode<T>
3636

3737
private(set) public var count = 0
38-
private var head: Node?
38+
fileprivate var head: Node?
3939
private var tail: Node?
4040
private var maxElements: Int
4141

@@ -55,7 +55,7 @@ public class BoundedPriorityQueue<T: Comparable> {
5555
The `BoundedPriorityQueue` class contains a doubly linked list of `LinkedListNode` objects. Nothing special here yet. The fun stuff happens in the `enqueue()` method:
5656

5757
```swift
58-
public func enqueue(value: T) {
58+
public func enqueue(_ value: T) {
5959
if let node = insert(value, after: findInsertionPoint(value)) {
6060
// If the newly inserted node is the last one in the list, then update
6161
// the tail pointer.
@@ -71,7 +71,7 @@ public func enqueue(value: T) {
7171
}
7272
}
7373

74-
private func insert(value: T, after: Node?) -> Node? {
74+
private func insert(_ value: T, after: Node?) -> Node? {
7575
if let previous = after {
7676

7777
// If the queue is full and we have to insert at the end of the list,
@@ -105,7 +105,7 @@ private func insert(value: T, after: Node?) -> Node? {
105105

106106
/* Find the node after which to insert the new value. If this returns nil,
107107
the new value should be inserted at the head of the list. */
108-
private func findInsertionPoint(value: T) -> Node? {
108+
private func findInsertionPoint(_ value: T) -> Node? {
109109
var node = head
110110
var prev: Node? = nil
111111

0 commit comments

Comments
 (0)