Skip to content

Commit

Permalink
Fix the position of the opening brace to conform to the style guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jawwad committed Nov 8, 2017
1 parent c742451 commit e466249
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Singly Linked List/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ SEARCH
Collections are sequences, therefore the first step is to conform to the Sequence protocol.

```
extension SinglyLinkedList : Sequence
{
public func makeIterator() -> SinglyLinkedListForwardIterator<T>
{
extension SinglyLinkedList: Sequence {
public func makeIterator() -> SinglyLinkedListForwardIterator<T> {
return SinglyLinkedListForwardIterator(head: self.storage.head)
}
}
Expand All @@ -70,8 +68,7 @@ public struct SinglyLinkedListForwardIterator<T> : IteratorProtocol {
private(set) var head: SinglyLinkedListNode<T>?
mutating public func next() -> T?
{
mutating public func next() -> T? {
let result = self.head?.value
self.head = self.head?.next
return result
Expand All @@ -82,8 +79,7 @@ public struct SinglyLinkedListForwardIterator<T> : IteratorProtocol {
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`.

```
public struct SinglyLinkedListIndex<T> : Comparable
{
public struct SinglyLinkedListIndex<T>: Comparable {
fileprivate let node: SinglyLinkedListNode<T>?
fileprivate let tag: Int
Expand Down

0 comments on commit e466249

Please sign in to comment.