minor code improvements for the obj code
- make use of range for loops - make use of empty() method for the std::vector - removed unnecessary std::string initialization - use ' ' instead of " " for the find methods (should be "faster") - simplified some function - make use of emplace_back instead of push_back (should be "faster") - other small changes
This commit is contained in:
@@ -274,7 +274,7 @@ void ObjFileMtlImporter::getFloatValue( ai_real &value )
|
||||
// Creates a material from loaded data.
|
||||
void ObjFileMtlImporter::createMaterial()
|
||||
{
|
||||
std::string line( "" );
|
||||
std::string line;
|
||||
while( !IsLineEnd( *m_DataIt ) ) {
|
||||
line += *m_DataIt;
|
||||
++m_DataIt;
|
||||
@@ -282,7 +282,7 @@ void ObjFileMtlImporter::createMaterial()
|
||||
|
||||
std::vector<std::string> token;
|
||||
const unsigned int numToken = tokenize<std::string>( line, token, " \t" );
|
||||
std::string name( "" );
|
||||
std::string name;
|
||||
if ( numToken == 1 ) {
|
||||
name = AI_DEFAULT_MATERIAL_NAME;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user