diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 50ea60b91..5031665a6 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -442,16 +442,15 @@ namespace Assimp { void FBXConverter::GetUniqueName(const std::string &name, std::string &uniqueName) { uniqueName = name; - auto it_pair = mNodeNameInstances.insert({ name, 0 }); // duplicate node name instance count + auto it_pair = mNodeNames.insert({ name, 0 }); // duplicate node name instance count unsigned int& i = it_pair.first->second; - auto uniqueIt_pair = mNodeNames.insert(uniqueName); - while (!uniqueIt_pair.second) + while (!it_pair.second) { i++; - std::stringstream ext; + std::ostringstream ext; ext << name << std::setfill('0') << std::setw(3) << i; uniqueName = ext.str(); - uniqueIt_pair = mNodeNames.insert(uniqueName); + it_pair = mNodeNames.insert({ uniqueName, 0 }); } } diff --git a/code/FBXConverter.h b/code/FBXConverter.h index f5de99ae3..dba7c0a05 100644 --- a/code/FBXConverter.h +++ b/code/FBXConverter.h @@ -462,10 +462,7 @@ private: NodeAnimBitMap node_anim_chain_bits; // number of nodes with the same name - using NodeAnimNameMap = std::unordered_map; - NodeAnimNameMap mNodeNameInstances; - - using NodeNameCache = std::unordered_set; + using NodeNameCache = std::unordered_map; NodeNameCache mNodeNames; double anim_fps;