Skip to content

Commit

Permalink
Fixed issue in LinkedList insert(_:, at:) method where next?.previous…
Browse files Browse the repository at this point in the history
… was referencing next itself.
  • Loading branch information
augustoavelino committed Jun 11, 2018
1 parent 7448846 commit 22e4496
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Linked List/LinkedList.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public final class LinkedList<T> {
list.head?.previous = prev

list.last?.next = next
next?.previous = list.last?.next
next?.previous = list.last
}
}

Expand Down
2 changes: 1 addition & 1 deletion Linked List/LinkedList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public final class LinkedList<T> {
list.head?.previous = prev

list.last?.next = next
next?.previous = list.last?.next
next?.previous = list.last
}
}

Expand Down

0 comments on commit 22e4496

Please sign in to comment.