| @@ 93-96 (lines=4) @@ | ||
| 90 | ||
| 91 | $current = $this->head; |
|
| 92 | $i = 0; |
|
| 93 | while($i < $index && $current->next !== null) { |
|
| 94 | $current = $current->next; |
|
| 95 | $i++; |
|
| 96 | } |
|
| 97 | ||
| 98 | return $current; |
|
| 99 | } |
|
| @@ 158-162 (lines=5) @@ | ||
| 155 | $i = 0; |
|
| 156 | $current = $this->head; |
|
| 157 | $prev = $current; |
|
| 158 | while($i < $index && $current->next !== null) { |
|
| 159 | $prev = $current; |
|
| 160 | $current = $current->next; |
|
| 161 | $i++; |
|
| 162 | } |
|
| 163 | ||
| 164 | $prev->next = &$newNode; |
|
| 165 | $newNode->next = &$current; |
|
| @@ 201-204 (lines=4) @@ | ||
| 198 | $i = 0; |
|
| 199 | $current = $this->head; |
|
| 200 | $prev = $current; |
|
| 201 | while($i < $index && $current->next !== null) { |
|
| 202 | $prev = $current; |
|
| 203 | $current = $current->next; |
|
| 204 | } |
|
| 205 | $prev->next = $current->next; |
|
| 206 | $this->size--; |
|
| 207 | ||