forked from Mirrors/openclonk
C4ValueMapNames: mark GetItemNr const
It doesn't change anything, so callers don't need a nonconst object.liquid_container
parent
607eb8e246
commit
96223f154c
|
@ -466,7 +466,7 @@ int32_t C4ValueMapNames::AddName(const char *pnName)
|
|||
return iSize-1;
|
||||
}
|
||||
|
||||
int32_t C4ValueMapNames::GetItemNr(const char *strName)
|
||||
int32_t C4ValueMapNames::GetItemNr(const char *strName) const
|
||||
{
|
||||
for (int32_t i = 0; i < iSize; i++)
|
||||
if (SEqual(pNames[i], strName))
|
||||
|
|
|
@ -118,7 +118,7 @@ public:
|
|||
// returns the nr of the given name
|
||||
// (= nr of value in "child" data lists)
|
||||
// returns -1 if no item with given name exists
|
||||
int32_t GetItemNr(const char *strName);
|
||||
int32_t GetItemNr(const char *strName) const;
|
||||
|
||||
// get name by index; awway bounds not checked
|
||||
const char *GetItemUnsafe(int32_t idx) const { return pNames[idx]; }
|
||||
|
|
Loading…
Reference in New Issue