| 95 | } |
| 96 | |
| 97 | void List::insert(int pos, ListItem *itemPtr) |
| 98 | { |
| 99 | if (pos == 0) |
| 100 | { |
| 101 | push_front(itemPtr); |
| 102 | } |
| 103 | else |
| 104 | { |
| 105 | int length = size(); |
| 106 | if (pos == length) |
| 107 | { |
| 108 | push_back(itemPtr); |
| 109 | } |
| 110 | else if (pos < length) |
| 111 | { |
| 112 | ListItem *temp = at(pos); |
| 113 | |
| 114 | itemPtr->previous = temp->previous; |
| 115 | itemPtr->next = temp; |
| 116 | temp->previous->next = itemPtr; |
| 117 | temp->previous = itemPtr; |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | void List::erase(int pos) |
| 123 | { |
nothing calls this directly
no outgoing calls
no test coverage detected