MCPcopy Create free account
hub / github.com/YatSenOS/YatSenOS-Tutorial-Volume-1 / erase

Method erase

lab8/src/3/src/utils/list.cpp:122–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void List::erase(int pos)
123{
124 if (pos == 0)
125 {
126 pop_front();
127 }
128 else
129 {
130 int length = size();
131 if (pos < length)
132 {
133 ListItem *temp = at(pos);
134
135 temp->previous->next = temp->next;
136 if (temp->next)
137 {
138 temp->next->previous = temp->previous;
139 }
140 }
141 }
142}
143
144void List::erase(ListItem *itemPtr)
145{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected