ObjTools: Update getName() to work with const iterators.
Ther's no need to convert the input parameter to a char * when we can just leave it as it is.pull/771/head
parent
0e4cf64a45
commit
c7d86e97cc
|
@ -141,7 +141,7 @@ inline char_t getName( char_t it, char_t end, std::string &name )
|
||||||
return end;
|
return end;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *pStart = &( *it );
|
char_t pStart = it;
|
||||||
while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) ) {
|
while( !isEndOfBuffer( it, end ) && !IsLineEnd( *it ) ) {
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
@ -153,10 +153,10 @@ inline char_t getName( char_t it, char_t end, std::string &name )
|
||||||
|
|
||||||
// Get name
|
// Get name
|
||||||
// if there is no name, and the previous char is a separator, come back to start
|
// if there is no name, and the previous char is a separator, come back to start
|
||||||
while (&(*it) < pStart) {
|
while (it < pStart) {
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
std::string strName( pStart, &(*it) );
|
std::string strName( pStart, it );
|
||||||
if ( strName.empty() )
|
if ( strName.empty() )
|
||||||
return it;
|
return it;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue