| Index: third_party/WebKit/Source/wtf/text/WTFString.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/text/WTFString.cpp b/third_party/WebKit/Source/wtf/text/WTFString.cpp
|
| index 1686121ee24e005b6c8e6d665fa2ffea99ed07e2..a5662bdf9ff685861451add2be191b007dfd009a 100644
|
| --- a/third_party/WebKit/Source/wtf/text/WTFString.cpp
|
| +++ b/third_party/WebKit/Source/wtf/text/WTFString.cpp
|
| @@ -248,34 +248,10 @@ void String::truncate(unsigned position)
|
| }
|
| }
|
|
|
| -template <typename CharacterType>
|
| -inline void String::removeInternal(const CharacterType* characters, unsigned position, int lengthToRemove)
|
| -{
|
| - CharacterType* data;
|
| - RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(length() - lengthToRemove, data);
|
| - memcpy(data, characters, position * sizeof(CharacterType));
|
| - memcpy(data + position, characters + position + lengthToRemove,
|
| - (length() - lengthToRemove - position) * sizeof(CharacterType));
|
| -
|
| - m_impl = newImpl.release();
|
| -}
|
| -
|
| -void String::remove(unsigned position, int lengthToRemove)
|
| +void String::remove(unsigned start, unsigned lengthToRemove)
|
| {
|
| - if (lengthToRemove <= 0)
|
| - return;
|
| - if (position >= length())
|
| - return;
|
| - if (static_cast<unsigned>(lengthToRemove) > length() - position)
|
| - lengthToRemove = length() - position;
|
| -
|
| - if (is8Bit()) {
|
| - removeInternal(characters8(), position, lengthToRemove);
|
| -
|
| - return;
|
| - }
|
| -
|
| - removeInternal(characters16(), position, lengthToRemove);
|
| + if (m_impl)
|
| + m_impl = m_impl->remove(start, lengthToRemove);
|
| }
|
|
|
| String String::substring(unsigned pos, unsigned len) const
|
|
|