One map to rule them all
parent
13bba4fb4c
commit
0eec1c1d4a
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -462,10 +462,7 @@ private:
|
|||
NodeAnimBitMap node_anim_chain_bits;
|
||||
|
||||
// number of nodes with the same name
|
||||
using NodeAnimNameMap = std::unordered_map<std::string, unsigned int>;
|
||||
NodeAnimNameMap mNodeNameInstances;
|
||||
|
||||
using NodeNameCache = std::unordered_set<std::string>;
|
||||
using NodeNameCache = std::unordered_map<std::string, unsigned int>;
|
||||
NodeNameCache mNodeNames;
|
||||
|
||||
double anim_fps;
|
||||
|
|
Loading…
Reference in New Issue