mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +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
|
|
@ -167,12 +167,10 @@ GuiInspectorField* GuiInspectorGroup::constructField( S32 fieldType )
|
|||
|
||||
|
||||
GuiInspectorDatablockField *dbFieldClass = new GuiInspectorDatablockField( typeClassName );
|
||||
if( dbFieldClass != NULL )
|
||||
{
|
||||
// return our new datablock field with correct datablock type enumeration info
|
||||
return dbFieldClass;
|
||||
}
|
||||
}
|
||||
|
||||
// return our new datablock field with correct datablock type enumeration info
|
||||
return dbFieldClass;
|
||||
}
|
||||
|
||||
// Nope, not a datablock. So maybe it has a valid inspector field override we can use?
|
||||
if(!cbt->getInspectorFieldType())
|
||||
|
|
|
|||
|
|
@ -52,13 +52,10 @@ void GuiVariableInspector::loadVars( String searchStr )
|
|||
group->setCaption( "Global Variables" );
|
||||
group->mSearchString = searchStr;
|
||||
|
||||
if( group != NULL )
|
||||
{
|
||||
group->registerObject();
|
||||
mGroups.push_back( group );
|
||||
addObject( group );
|
||||
}
|
||||
|
||||
group->registerObject();
|
||||
mGroups.push_back( group );
|
||||
addObject( group );
|
||||
|
||||
//group->inspectGroup();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue