Revert changes
Former-commit-id: 25a7ecad35f3fe38638f608f375ed9c8c5df873e [formerly fa3383a06a186551d427aee0e3def1e543b73a1b] Former-commit-id: 5923cbbb60c4464741449c997c39212d2bc075f8
This commit is contained in:
@@ -2827,15 +2827,21 @@ namespace Nz
|
||||
{
|
||||
const char* c = oldCharacters;
|
||||
char character = Detail::ToLower(*ptr);
|
||||
|
||||
std::ptrdiff_t offset = ptr - m_sharedString->string.get();
|
||||
EnsureOwnership();
|
||||
ptr = &m_sharedString->string[offset];
|
||||
|
||||
bool found = false;
|
||||
do
|
||||
{
|
||||
if (character == Detail::ToLower(*c))
|
||||
{
|
||||
if (!found)
|
||||
{
|
||||
std::ptrdiff_t offset = ptr - m_sharedString->string.get();
|
||||
|
||||
EnsureOwnership();
|
||||
|
||||
ptr = &m_sharedString->string[offset];
|
||||
found = true;
|
||||
}
|
||||
|
||||
*ptr = replaceCharacter;
|
||||
++count;
|
||||
break;
|
||||
@@ -2847,12 +2853,19 @@ namespace Nz
|
||||
}
|
||||
else
|
||||
{
|
||||
std::ptrdiff_t offset = ptr - m_sharedString->string.get();
|
||||
EnsureOwnership();
|
||||
ptr = &m_sharedString->string[offset];
|
||||
|
||||
bool found = false;
|
||||
while ((ptr = std::strpbrk(ptr, oldCharacters)) != nullptr)
|
||||
{
|
||||
if (!found)
|
||||
{
|
||||
std::ptrdiff_t offset = ptr - m_sharedString->string.get();
|
||||
|
||||
EnsureOwnership();
|
||||
|
||||
ptr = &m_sharedString->string[offset];
|
||||
found = true;
|
||||
}
|
||||
|
||||
*ptr++ = replaceCharacter;
|
||||
++count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user