Optimize initial MultiLevelInv clear
Change the clearing of MultiLevelInv during initialization to reduce wasted stores. MultiLevelInv has three fields. Field ::Initial is not accessed by MultiLevelInv_CountLevelPowerups, and is overwritten immediately afterward, so it does not need to be cleared first. Field ::Current is unconditionally cleared by MultiLevelInv_CountLevelPowerups, so it does not need to be cleared first. Field ::RespawnTimer is not accessed by MultiLevelInv_CountLevelPowerups, but needs to be cleared. Add a clear of field .RespawnTimer and remove the clear of the entire structure.
This commit is contained in:
parent
5af44fa27a
commit
96d9ae4e4a
|
@ -5097,9 +5097,9 @@ static void MultiLevelInv_CountPlayerInventory()
|
|||
|
||||
void MultiLevelInv_InitializeCount()
|
||||
{
|
||||
MultiLevelInv = {};
|
||||
MultiLevelInv_CountLevelPowerups();
|
||||
MultiLevelInv.Initial = MultiLevelInv.Current;
|
||||
MultiLevelInv.RespawnTimer = {};
|
||||
}
|
||||
|
||||
void MultiLevelInv_Recount()
|
||||
|
|
Loading…
Reference in a new issue