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

Method get_at

Kernel/include/list.h:128–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126 }
127
128 T get_at(unsigned pos) {
129 assert(num > 0 && pos < num && front);
130 /*if (num <= 0 || pos >= num || front == NULL) {
131 return nullptr;
132 }*/
133
134 T current = front;
135
136 for (unsigned int i = 0; i < pos && i < num && current->next; i++) current = current->next;
137
138 return current;
139 }
140
141 __attribute__((always_inline)) inline unsigned get_length() {
142 return num;

Callers 15

PeekMethod · 0.80
EndProcessFunction · 0.80
InitializeFunction · 0.80
MapLegacyIRQFunction · 0.80
SysExecFunction · 0.80
SysFStatFunction · 0.80
SysPReadFunction · 0.80
SysPWriteFunction · 0.80
SysBindFunction · 0.80
SysListenFunction · 0.80
SysAcceptFunction · 0.80
SysConnectFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected