MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / replace_at

Method replace_at

Kernel/include/list.h:355–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353 }
354
355 void replace_at(unsigned pos, T obj) {
356 assert(num > 0 && pos < num);
357 //if (num < 0 || pos >= num) return;
358
359 acquireLock(&lock);
360
361 ListNode<T>* current = front;
362
363 for (unsigned int i = 0; i < pos; i++) current = current->next;
364
365 if(current)
366 current->obj = obj;
367
368 releaseLock(&lock);
369 }
370
371 unsigned get_length() {
372 return num;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected