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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringImpl.cpp

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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller ( mueller@kde.org ) 4 * (C) 2001 Dirk Mueller ( mueller@kde.org )
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 return findIgnoringASCIICaseInner(searchStart, matchString->characte rs8(), index, searchLength, matchLength); 1424 return findIgnoringASCIICaseInner(searchStart, matchString->characte rs8(), index, searchLength, matchLength);
1425 return findIgnoringASCIICaseInner(searchStart, matchString->characters16 (), index, searchLength, matchLength); 1425 return findIgnoringASCIICaseInner(searchStart, matchString->characters16 (), index, searchLength, matchLength);
1426 } 1426 }
1427 1427
1428 const UChar* searchStart = characters16() + index; 1428 const UChar* searchStart = characters16() + index;
1429 if (matchString->is8Bit()) 1429 if (matchString->is8Bit())
1430 return findIgnoringASCIICaseInner(searchStart, matchString->characters8( ), index, searchLength, matchLength); 1430 return findIgnoringASCIICaseInner(searchStart, matchString->characters8( ), index, searchLength, matchLength);
1431 return findIgnoringASCIICaseInner(searchStart, matchString->characters16(), index, searchLength, matchLength); 1431 return findIgnoringASCIICaseInner(searchStart, matchString->characters16(), index, searchLength, matchLength);
1432 } 1432 }
1433 1433
1434 size_t StringImpl::findNextLineStart(unsigned index)
1435 {
1436 if (is8Bit())
1437 return WTF::findNextLineStart(characters8(), m_length, index);
1438 return WTF::findNextLineStart(characters16(), m_length, index);
1439 }
1440
1441 size_t StringImpl::count(LChar c) const
1442 {
1443 int count = 0;
1444 if (is8Bit()) {
1445 for (size_t i = 0; i < m_length; ++i)
1446 count += characters8()[i] == c;
1447 } else {
1448 for (size_t i = 0; i < m_length; ++i)
1449 count += characters16()[i] == c;
1450 }
1451 return count;
1452 }
1453
1454 size_t StringImpl::reverseFind(UChar c, unsigned index) 1434 size_t StringImpl::reverseFind(UChar c, unsigned index)
1455 { 1435 {
1456 if (is8Bit()) 1436 if (is8Bit())
1457 return WTF::reverseFind(characters8(), m_length, c, index); 1437 return WTF::reverseFind(characters8(), m_length, c, index);
1458 return WTF::reverseFind(characters16(), m_length, c, index); 1438 return WTF::reverseFind(characters16(), m_length, c, index);
1459 } 1439 }
1460 1440
1461 template <typename SearchCharacterType, typename MatchCharacterType> 1441 template <typename SearchCharacterType, typename MatchCharacterType>
1462 ALWAYS_INLINE static size_t reverseFindInner(const SearchCharacterType* searchCh aracters, const MatchCharacterType* matchCharacters, unsigned index, unsigned le ngth, unsigned matchLength) 1442 ALWAYS_INLINE static size_t reverseFindInner(const SearchCharacterType* searchCh aracters, const MatchCharacterType* matchCharacters, unsigned index, unsigned le ngth, unsigned matchLength)
1463 { 1443 {
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 } else if (localeIdMatchesLang(localeIdentifier, "lt")) { 2338 } else if (localeIdMatchesLang(localeIdentifier, "lt")) {
2359 // TODO(rob.buis) implement upper-casing rules for lt 2339 // TODO(rob.buis) implement upper-casing rules for lt
2360 // like in StringImpl::upper(locale). 2340 // like in StringImpl::upper(locale).
2361 } 2341 }
2362 } 2342 }
2363 2343
2364 return toUpper(c); 2344 return toUpper(c);
2365 } 2345 }
2366 2346
2367 } // namespace WTF 2347 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.h ('k') | third_party/WebKit/Source/wtf/text/WTFString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698