Skip to content

Commit 548413a

Browse files
authored
Merge pull request kodecocodes#724 from highborncow/LinkedListFix
Fixed issue in LinkedList insert(_:, at:) method where next?.previous…
2 parents 7448846 + 22e4496 commit 548413a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Linked List/LinkedList.playground/Contents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public final class LinkedList<T> {
176176
list.head?.previous = prev
177177

178178
list.last?.next = next
179-
next?.previous = list.last?.next
179+
next?.previous = list.last
180180
}
181181
}
182182

Linked List/LinkedList.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public final class LinkedList<T> {
166166
list.head?.previous = prev
167167

168168
list.last?.next = next
169-
next?.previous = list.last?.next
169+
next?.previous = list.last
170170
}
171171
}
172172

0 commit comments

Comments
 (0)