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

Method find

lab6/src/1/src/utils/list.cpp:173–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173int List::find(ListItem *itemPtr)
174{
175 int pos = 0;
176 ListItem *temp = head.next;
177 while (temp && temp != itemPtr)
178 {
179 temp = temp->next;
180 ++pos;
181 }
182
183 if (temp && temp == itemPtr)
184 {
185 return pos;
186 }
187 else
188 {
189 return -1;
190 }
191}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected