Changeset 202506 in webkit


Ignore:
Timestamp:
Jun 27, 2016 12:11:33 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Joseph Pecoraro <Joseph Pecoraro> 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.

Location:
trunk/Source/WTF
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r202439 r202506  
     12016-06-27  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Remove now unused WTF::findNextLineStart
     4        https://bugs.webkit.org/show_bug.cgi?id=159157
     5
     6        Reviewed by Mark Lam.
     7
     8        Unused after r202498.
     9
     10        * wtf/text/StringImpl.cpp:
     11        (WTF::StringImpl::findNextLineStart): Deleted.
     12        * wtf/text/StringImpl.h:
     13        (WTF::findNextLineStart): Deleted.
     14        * wtf/text/WTFString.h:
     15        (WTF::String::findNextLineStart): Deleted.
     16
    1172016-06-21  Anders Carlsson  <andersca@apple.com>
    218
  • trunk/Source/WTF/wtf/text/StringImpl.cpp

    r201782 r202506  
    12631263        return notFound;
    12641264    return ::WTF::findIgnoringASCIICase(*this, *matchString, startOffset);
    1265 }
    1266 
    1267 size_t StringImpl::findNextLineStart(unsigned index)
    1268 {
    1269     if (is8Bit())
    1270         return WTF::findNextLineStart(characters8(), m_length, index);
    1271     return WTF::findNextLineStart(characters16(), m_length, index);
    12721265}
    12731266
  • trunk/Source/WTF/wtf/text/StringImpl.h

    r201782 r202506  
    710710    WTF_EXPORT_STRING_API size_t findIgnoringASCIICase(const StringImpl*, unsigned startOffset) const;
    711711
    712     WTF_EXPORT_STRING_API size_t findNextLineStart(unsigned index = UINT_MAX);
    713 
    714712    WTF_EXPORT_STRING_API size_t reverseFind(UChar, unsigned index = UINT_MAX);
    715713    WTF_EXPORT_STRING_API size_t reverseFind(StringImpl*, unsigned index = UINT_MAX);
     
    976974
    977975template<typename CharacterType>
    978 inline size_t findNextLineStart(const CharacterType* characters, unsigned length, unsigned index = 0)
    979 {
    980     while (index < length) {
    981         CharacterType c = characters[index++];
    982         if ((c != '\n') && (c != '\r'))
    983             continue;
    984 
    985         // There can only be a start of a new line if there are more characters
    986         // beyond the current character.
    987         if (index < length) {
    988             // The 3 common types of line terminators are 1. \r\n (Windows),
    989             // 2. \r (old MacOS) and 3. \n (Unix'es).
    990 
    991             if (c == '\n')
    992                 return index; // Case 3: just \n.
    993 
    994             CharacterType c2 = characters[index];
    995             if (c2 != '\n')
    996                 return index; // Case 2: just \r.
    997 
    998             // Case 1: \r\n.
    999             // But, there's only a start of a new line if there are more
    1000             // characters beyond the \r\n.
    1001             if (++index < length)
    1002                 return index;
    1003         }
    1004     }
    1005     return notFound;
    1006 }
    1007 
    1008 template<typename CharacterType>
    1009976inline size_t reverseFindLineTerminator(const CharacterType* characters, unsigned length, unsigned index = UINT_MAX)
    1010977{
  • trunk/Source/WTF/wtf/text/WTFString.h

    r201782 r202506  
    230230    size_t find(const LChar* str, unsigned start = 0) const
    231231        { return m_impl ? m_impl->find(str, start) : notFound; }
    232 
    233     size_t findNextLineStart(unsigned start = 0) const
    234         { return m_impl ? m_impl->findNextLineStart(start) : notFound; }
    235232
    236233    // Find the last instance of a single character or string.
Note: See TracChangeset for help on using the changeset viewer.