MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetItemIndex

Method GetItemIndex

src/engine/shared/snapshot.cpp:62–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62int CSnapshot::GetItemIndex(int Key) const
63{
64 // TODO: OPT: this should not be a linear search. very bad
65 for(int i = 0; i < m_NumItems; i++)
66 {
67 if(GetItem(i)->Key() == Key)
68 return i;
69 }
70 return -1;
71}
72
73void CSnapshot::InvalidateItem(int Index)
74{

Callers 1

UnpackDeltaMethod · 0.80

Calls 1

KeyMethod · 0.80

Tested by

no test coverage detected