Chromium Code Reviews| Index: src/core/SkString.cpp |
| diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp |
| index b43351599f114c0d7f0b3a1d2e179e3a26b3bca1..fb0c0ec2143f5ffb30dc01c54cbe2ecdb830a19e 100644 |
| --- a/src/core/SkString.cpp |
| +++ b/src/core/SkString.cpp |
| @@ -628,6 +628,20 @@ void SkString::remove(size_t offset, size_t length) { |
| } |
| } |
| +void SkString::replace(SkUnichar oldChar, SkUnichar newChar) { |
| + char buffer[kMaxBytesInUTF8Sequence]; |
| + size_t len = SkUTF8_FromUnichar(oldChar, buffer); |
|
tfarina
2014/11/12 01:41:34
Mike, could you help me here?
I'm getting the fol
|
| + |
| + if (len) { |
| + } |
| + |
| + for (size_t i = 0; i < size(); ++i) { |
| + if (oldChar == this->operator[](i)) { |
| + this->operator[](i) = newChar; |
| + } |
| + } |
| +} |
| + |
| void SkString::swap(SkString& other) { |
| this->validate(); |
| other.validate(); |