Extract pItem variable to avoid duplicate GetItem call

This commit is contained in:
Robert Müller 2024-09-19 13:38:02 +02:00
parent 9a380ff199
commit ac9c66047c

View file

@ -742,8 +742,11 @@ int *CSnapshotBuilder::GetItemData(int Key)
{
for(int i = 0; i < m_NumItems; i++)
{
if(GetItem(i)->Key() == Key)
return GetItem(i)->Data();
CSnapshotItem *pItem = GetItem(i);
if(pItem->Key() == Key)
{
return pItem->Data();
}
}
return nullptr;
}