mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Issue found with PVS-Studio:
Many instances of a function or expression being used repeatedly, which can lower performance. Fixed it in these cases by creating on local var, reference or pointer that's used instead.
This commit is contained in:
parent
ec63398042
commit
2002d74b78
38 changed files with 465 additions and 371 deletions
|
|
@ -1353,15 +1353,16 @@ F32 SceneContainer::containerSearchCurrRadiusDist()
|
|||
return 0.0;
|
||||
|
||||
Point3F pos;
|
||||
(*mSearchList[mCurrSearchPos])->getWorldBox().getCenter(&pos);
|
||||
Box3F worldBox = (*mSearchList[mCurrSearchPos])->getWorldBox();
|
||||
worldBox.getCenter(&pos);
|
||||
|
||||
F32 dist = (pos - mSearchReferencePoint).len();
|
||||
|
||||
F32 min = (*mSearchList[mCurrSearchPos])->getWorldBox().len_x();
|
||||
if ((*mSearchList[mCurrSearchPos])->getWorldBox().len_y() < min)
|
||||
min = (*mSearchList[mCurrSearchPos])->getWorldBox().len_y();
|
||||
if ((*mSearchList[mCurrSearchPos])->getWorldBox().len_z() < min)
|
||||
min = (*mSearchList[mCurrSearchPos])->getWorldBox().len_z();
|
||||
F32 min = worldBox.len_x();
|
||||
if (worldBox.len_y() < min)
|
||||
min = worldBox.len_y();
|
||||
if (worldBox.len_z() < min)
|
||||
min = worldBox.len_z();
|
||||
|
||||
dist -= min;
|
||||
if (dist < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue