mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Issue found with PVS-Studio:
Many instances where we would create a object via a new call, and then check that it was non-null. This is redundant, as if we ever were in a situation where new failed, we'd be crashing left and right already, so the additional check is wasted processing.
This commit is contained in:
parent
db532c0e1a
commit
527c3790d6
15 changed files with 164 additions and 262 deletions
|
|
@ -748,11 +748,6 @@ S32 GuiListBoxCtrl::insertItem( S32 index, StringTableEntry text, void *itemData
|
|||
}
|
||||
|
||||
LBItem *newItem = new LBItem;
|
||||
if( !newItem )
|
||||
{
|
||||
Con::warnf("GuiListBoxCtrl::insertItem - error allocating item memory!" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Assign item data
|
||||
newItem->itemText = StringTable->insert(text, true);
|
||||
|
|
@ -792,11 +787,6 @@ S32 GuiListBoxCtrl::insertItemWithColor( S32 index, StringTableEntry text, Color
|
|||
}
|
||||
|
||||
LBItem *newItem = new LBItem;
|
||||
if( !newItem )
|
||||
{
|
||||
Con::warnf("GuiListBoxCtrl::insertItem - error allocating item memory!" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Assign item data
|
||||
newItem->itemText = StringTable->insert(text, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue