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

Method FindItemIndex

src/engine/shared/datafile.cpp:882–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880}
881
882int CDataFileReader::FindItemIndex(int Type, int Id)
883{
884 dbg_assert(m_pDataFile != nullptr, "File not open");
885
886 int Start, Num;
887 GetType(Type, &Start, &Num);
888 for(int Index = Start; Index < Start + Num; Index++)
889 {
890 const CDatafileItem *pItem = m_pDataFile->GetItem(Index);
891 if(pItem->Id() == Id)
892 {
893 return Index;
894 }
895 }
896 return -1;
897}
898
899void *CDataFileReader::FindItem(int Type, int Id)
900{

Callers

nothing calls this directly

Calls 2

GetItemMethod · 0.45
IdMethod · 0.45

Tested by

no test coverage detected