Упростил функцию поиска символа
This commit is contained in:
parent
23f2e7f927
commit
829142997f
@ -354,15 +354,13 @@ bool ustring::operator!=( const ustring& str ) const
|
||||
std::size_t ustring::find(char32_t symbol, std::size_t pos /* = 0 */) const
|
||||
{
|
||||
char32_t* pBuf = _pData + pos;
|
||||
std::size_t result = 0;
|
||||
|
||||
do
|
||||
{
|
||||
if(*pBuf == symbol)
|
||||
{
|
||||
return (result + pos);
|
||||
return (pBuf - _pData);
|
||||
}
|
||||
++result;
|
||||
}
|
||||
while(*pBuf++ != 0);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user