Title: [202506] trunk/Source/WTF
Revision
202506
Author
[email protected]
Date
2016-06-27 12:11:33 -0700 (Mon, 27 Jun 2016)

Log Message

Remove now unused WTF::findNextLineStart
https://bugs.webkit.org/show_bug.cgi?id=159157

Patch by Joseph Pecoraro <[email protected]> on 2016-06-27
Reviewed by Mark Lam.

Unused after r202498.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::findNextLineStart): Deleted.
* wtf/text/StringImpl.h:
(WTF::findNextLineStart): Deleted.
* wtf/text/WTFString.h:
(WTF::String::findNextLineStart): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (202505 => 202506)


--- trunk/Source/WTF/ChangeLog	2016-06-27 19:06:45 UTC (rev 202505)
+++ trunk/Source/WTF/ChangeLog	2016-06-27 19:11:33 UTC (rev 202506)
@@ -1,3 +1,19 @@
+2016-06-27  Joseph Pecoraro  <[email protected]>
+
+        Remove now unused WTF::findNextLineStart
+        https://bugs.webkit.org/show_bug.cgi?id=159157
+
+        Reviewed by Mark Lam.
+
+        Unused after r202498.
+
+        * wtf/text/StringImpl.cpp:
+        (WTF::StringImpl::findNextLineStart): Deleted.
+        * wtf/text/StringImpl.h:
+        (WTF::findNextLineStart): Deleted.
+        * wtf/text/WTFString.h:
+        (WTF::String::findNextLineStart): Deleted.
+
 2016-06-21  Anders Carlsson  <[email protected]>
 
         Rename NoncopyableFunction to Function

Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (202505 => 202506)


--- trunk/Source/WTF/wtf/text/StringImpl.cpp	2016-06-27 19:06:45 UTC (rev 202505)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp	2016-06-27 19:11:33 UTC (rev 202506)
@@ -1264,13 +1264,6 @@
     return ::WTF::findIgnoringASCIICase(*this, *matchString, startOffset);
 }
 
-size_t StringImpl::findNextLineStart(unsigned index)
-{
-    if (is8Bit())
-        return WTF::findNextLineStart(characters8(), m_length, index);
-    return WTF::findNextLineStart(characters16(), m_length, index);
-}
-
 size_t StringImpl::reverseFind(UChar c, unsigned index)
 {
     if (is8Bit())

Modified: trunk/Source/WTF/wtf/text/StringImpl.h (202505 => 202506)


--- trunk/Source/WTF/wtf/text/StringImpl.h	2016-06-27 19:06:45 UTC (rev 202505)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2016-06-27 19:11:33 UTC (rev 202506)
@@ -709,8 +709,6 @@
     WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringImpl*) const;
     WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringImpl*, unsigned startOffset) const;
 
-    WTF_EXPORT_STRING_API size_t findNextLineStart(unsigned index = UINT_MAX);
-
     WTF_EXPORT_STRING_API size_t reverseFind(UChar, unsigned index = UINT_MAX);
     WTF_EXPORT_STRING_API size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
     WTF_EXPORT_STRING_API size_t reverseFindIgnoringCase(StringImpl*, unsigned index = UINT_MAX);
@@ -975,37 +973,6 @@
 }
 
 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 notFound;
-}
-
-template<typename CharacterType>
 inline size_t reverseFindLineTerminator(const CharacterType* characters, unsigned length, unsigned index = UINT_MAX)
 {
     if (!length)

Modified: trunk/Source/WTF/wtf/text/WTFString.h (202505 => 202506)


--- trunk/Source/WTF/wtf/text/WTFString.h	2016-06-27 19:06:45 UTC (rev 202505)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2016-06-27 19:11:33 UTC (rev 202506)
@@ -230,9 +230,6 @@
     size_t find(const LChar* str, unsigned start = 0) const
         { return m_impl ? m_impl->find(str, start) : notFound; }
 
-    size_t findNextLineStart(unsigned start = 0) const
-        { return m_impl ? m_impl->findNextLineStart(start) : notFound; }
-
     // Find the last instance of a single character or string.
     size_t reverseFind(UChar c, unsigned start = UINT_MAX) const
         { return m_impl ? m_impl->reverseFind(c, start) : notFound; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to