mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
Extract pItem
variable to avoid duplicate GetItem
call
This commit is contained in:
parent
9a380ff199
commit
ac9c66047c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue