@@ 69-72 (lines=4) @@ | ||
66 | ||
67 | $current = $this->head; |
|
68 | $i = 0; |
|
69 | while($i < $index && $current->next !== null) { |
|
70 | $current = $current->next; |
|
71 | $i++; |
|
72 | } |
|
73 | ||
74 | return $current; |
|
75 | } |
|
@@ 267-270 (lines=4) @@ | ||
264 | $i = 0; |
|
265 | $current = $this->head; |
|
266 | $prev = $current; |
|
267 | while($i < $index && $current->next !== null) { |
|
268 | $prev = $current; |
|
269 | $current = $current->next; |
|
270 | } |
|
271 | ||
272 | if($index === $this->size - 1) { |
|
273 | $prev->next = null; |