Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: third_party/WebKit/Source/wtf/text/StringImpl.h

Issue 2149463002: Remove unused StringImpl::findNextLineStart, StringImpl::count and reverseFindLineTerminator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/StringImpl.h
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.h b/third_party/WebKit/Source/wtf/text/StringImpl.h
index 22897f18998bd09c2e5588c9f36090b7af8920bc..c1cb3ee476a0cd58c856f9264baef345c26c8128 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.h
@@ -379,13 +379,9 @@ public:
size_t findIgnoringCase(StringImpl*, unsigned index = 0);
size_t findIgnoringASCIICase(StringImpl*, unsigned index = 0);
- size_t findNextLineStart(unsigned index = UINT_MAX);
-
size_t reverseFind(UChar, unsigned index = UINT_MAX);
size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
- size_t count(LChar) const;
-
bool startsWith(UChar) const;
bool startsWith(const char*, unsigned prefixLength) const;
bool startsWith(const StringImpl*) const;
@@ -586,53 +582,6 @@ inline size_t find(const UChar* characters, unsigned length, CharacterMatchFunct
}
template<typename CharacterType>
-inline size_t findNextLineStart(const CharacterType* characters, unsigned length, unsigned index = 0)
-{
- while (index < length) {
- CharacterType c = characters[index++];
- if ((c != '\n') && (c != '\r'))
- continue;
-
- // There can only be a start of a new line if there are more characters
- // beyond the current character.
- if (index < length) {
- // The 3 common types of line terminators are 1. \r\n (Windows),
- // 2. \r (old MacOS) and 3. \n (Unix'es).
-
- if (c == '\n')
- return index; // Case 3: just \n.
-
- CharacterType c2 = characters[index];
- if (c2 != '\n')
- return index; // Case 2: just \r.
-
- // Case 1: \r\n.
- // But, there's only a start of a new line if there are more
- // characters beyond the \r\n.
- if (++index < length)
- return index;
- }
- }
- return kNotFound;
-}
-
-template<typename CharacterType>
-inline size_t reverseFindLineTerminator(const CharacterType* characters, unsigned length, unsigned index = UINT_MAX)
-{
- if (!length)
- return kNotFound;
- if (index >= length)
- index = length - 1;
- CharacterType c = characters[index];
- while ((c != '\n') && (c != '\r')) {
- if (!index--)
- return kNotFound;
- c = characters[index];
- }
- return index;
-}
-
-template<typename CharacterType>
inline size_t reverseFind(const CharacterType* characters, unsigned length, CharacterType matchCharacter, unsigned index = UINT_MAX)
{
if (!length)
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698