Skip to content

Commit e466249

Browse files
committed
Fix the position of the opening brace to conform to the style guide
1 parent c742451 commit e466249

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Singly Linked List/README.markdown

+4-8
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ SEARCH
5252
Collections are sequences, therefore the first step is to conform to the Sequence protocol.
5353

5454
```
55-
extension SinglyLinkedList : Sequence
56-
{
57-
public func makeIterator() -> SinglyLinkedListForwardIterator<T>
58-
{
55+
extension SinglyLinkedList: Sequence {
56+
public func makeIterator() -> SinglyLinkedListForwardIterator<T> {
5957
return SinglyLinkedListForwardIterator(head: self.storage.head)
6058
}
6159
}
@@ -70,8 +68,7 @@ public struct SinglyLinkedListForwardIterator<T> : IteratorProtocol {
7068
7169
private(set) var head: SinglyLinkedListNode<T>?
7270
73-
mutating public func next() -> T?
74-
{
71+
mutating public func next() -> T? {
7572
let result = self.head?.value
7673
self.head = self.head?.next
7774
return result
@@ -82,8 +79,7 @@ public struct SinglyLinkedListForwardIterator<T> : IteratorProtocol {
8279
Next, a collection needs to be indexable. Indexes are implemented by the data structure class. We have encapsulated this knowledge in instances of the class `SinglyLinkedListIndex`.
8380

8481
```
85-
public struct SinglyLinkedListIndex<T> : Comparable
86-
{
82+
public struct SinglyLinkedListIndex<T>: Comparable {
8783
fileprivate let node: SinglyLinkedListNode<T>?
8884
fileprivate let tag: Int
8985

0 commit comments

Comments
 (0)