diff options
author | Ben Murdoch <benm@google.com> | 2010-07-22 15:37:06 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-27 10:20:25 +0100 |
commit | 967717af5423377c967781471ee106e2bb4e11c8 (patch) | |
tree | 1e701dc0a12f7f07cce1df4a7681717de77a211b /JavaScriptCore/wtf/text | |
parent | dcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff) | |
download | external_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2 |
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'JavaScriptCore/wtf/text')
-rw-r--r-- | JavaScriptCore/wtf/text/StringImpl.h | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/JavaScriptCore/wtf/text/StringImpl.h b/JavaScriptCore/wtf/text/StringImpl.h index a172e2c..244009f 100644 --- a/JavaScriptCore/wtf/text/StringImpl.h +++ b/JavaScriptCore/wtf/text/StringImpl.h @@ -257,37 +257,6 @@ public: memcpy(destination, source, numCharacters * sizeof(UChar)); } - PassRefPtr<StringImpl> copyStringWithoutBOMs(bool definitelyHasBOMs, bool& hasBOMs) - { - static const UChar byteOrderMark = 0xFEFF; - size_t i = 0; - if (!definitelyHasBOMs) { - hasBOMs = false; - // ECMA-262 calls for stripping all Cf characters, but we only strip BOM characters. - // See <https://bugs.webkit.org/show_bug.cgi?id=4931> for details. - for (; i < m_length; i++) { - if (UNLIKELY(m_data[i] == byteOrderMark)) { - hasBOMs = true; - break; - } - } - if (!hasBOMs) - return this; - } - Vector<UChar> result; - result.reserveInitialCapacity(m_length); - size_t firstBOM = i; - i = 0; - for (; i < firstBOM; i++) - result.append(m_data[i]); - for (; i < m_length; i++) { - UChar c = m_data[i]; - if (c != byteOrderMark) - result.append(c); - } - return StringImpl::adopt(result); - } - // Returns a StringImpl suitable for use on another thread. PassRefPtr<StringImpl> crossThreadString(); // Makes a deep copy. Helpful only if you need to use a String on another thread |