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++) for(int i = 0; i < m_NumItems; i++)
{ {
if(GetItem(i)->Key() == Key) CSnapshotItem *pItem = GetItem(i);
return GetItem(i)->Data(); if(pItem->Key() == Key)
{
return pItem->Data();
}
} }
return nullptr; return nullptr;
} }