Strings - Fixed compiler warning
This commit is contained in:
parent
30d8d3057e
commit
e2f548d55e
1 changed files with 7 additions and 4 deletions
|
@ -1425,24 +1425,27 @@ T_String T_String::trim( ) const noexcept
|
||||||
return T_String( );
|
return T_String( );
|
||||||
}
|
}
|
||||||
|
|
||||||
T_Optional< uint32_t > firstNws;
|
bool hasFirst = false;
|
||||||
|
uint32_t firstNws = 0;
|
||||||
uint32_t lastNws = 0;
|
uint32_t lastNws = 0;
|
||||||
T_StringIterator it( *this );
|
T_StringIterator it( *this );
|
||||||
while ( !it.atEnd( ) ) {
|
while ( !it.atEnd( ) ) {
|
||||||
T_Character c( it );
|
T_Character c( it );
|
||||||
if ( !c.isWhitespace( ) ) {
|
if ( !c.isWhitespace( ) ) {
|
||||||
if ( !firstNws ) {
|
if ( !hasFirst ) {
|
||||||
firstNws = it.index( );
|
firstNws = it.index( );
|
||||||
|
hasFirst = true;
|
||||||
}
|
}
|
||||||
lastNws = it.index( );
|
lastNws = it.index( );
|
||||||
}
|
}
|
||||||
it.next( );
|
it.next( );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !firstNws ) {
|
if ( hasFirst ) {
|
||||||
|
return range( firstNws , lastNws );
|
||||||
|
} else {
|
||||||
return T_String( );
|
return T_String( );
|
||||||
}
|
}
|
||||||
return range( *firstNws , lastNws );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue