- add missing initialization of several class members

- prefer check for empty() over check for size() in OptimizeGraph (empty() is guaranteed to be constant time, size() is not)
- fix a couple of incorrect indentations
This commit is contained in:
Andy Maloney
2015-05-16 15:13:22 -04:00
parent 93579ca734
commit c014bb977c
7 changed files with 42 additions and 17 deletions

View File

@@ -71,6 +71,10 @@ using namespace Assimp;
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
OptimizeGraphProcess::OptimizeGraphProcess()
: mScene()
, nodes_in()
, nodes_out()
, count_merged()
{}
// ------------------------------------------------------------------------------------------------
@@ -122,7 +126,7 @@ void OptimizeGraphProcess::CollectNewChildren(aiNode* nd, std::list<aiNode*>& no
++it;
}
if (nd->mNumMeshes || child_nodes.size()) {
if (nd->mNumMeshes || !child_nodes.empty()) {
nodes.push_back(nd);
}
else {
@@ -172,7 +176,7 @@ void OptimizeGraphProcess::CollectNewChildren(aiNode* nd, std::list<aiNode*>& no
}
++it;
}
if (join_master && join.size()) {
if (join_master && !join.empty()) {
join_master->mName.length = sprintf(join_master->mName.data,"$MergedNode_%i",count_merged++);
unsigned int out_meshes = 0;