| @@ 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 | } |
|
| @@ 139-143 (lines=5) @@ | ||
| 136 | $i = 0; |
|
| 137 | $current = $this->head; |
|
| 138 | $prev = $current; |
|
| 139 | while($i < $index && $current->next !== null) { |
|
| 140 | $prev = $current; |
|
| 141 | $current = $current->next; |
|
| 142 | $i++; |
|
| 143 | } |
|
| 144 | ||
| 145 | $prev->next = &$newNode; |
|
| 146 | $newNode->next = &$current; |
|
| @@ 182-185 (lines=4) @@ | ||
| 179 | $i = 0; |
|
| 180 | $current = $this->head; |
|
| 181 | $prev = $current; |
|
| 182 | while($i < $index && $current->next !== null) { |
|
| 183 | $prev = $current; |
|
| 184 | $current = $current->next; |
|
| 185 | } |
|
| 186 | $prev->next = $current->next; |
|
| 187 | $this->size--; |
|
| 188 | ||