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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/CharacterIterator.h

Issue 1604783002: ALL-IN-ONE: Optimization to previousBoundary() and nextBoundary() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@progressive_accumulator
Patch Set: Created 4 years, 11 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
Index: third_party/WebKit/Source/core/editing/iterators/CharacterIterator.h
diff --git a/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.h b/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.h
index 8540c72b6166e703bd8e5172cfde98f3426c0272..3c895e3d395dfbec33d6dd71efac970b50414c8c 100644
--- a/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.h
+++ b/third_party/WebKit/Source/core/editing/iterators/CharacterIterator.h
@@ -41,6 +41,10 @@ template <typename Strategy>
class CORE_EXPORT CharacterIteratorAlgorithm {
STACK_ALLOCATED();
public:
+
+ using PositionType = PositionTemplate<Strategy>;
+ static const TextIteratorDirection direction = TextIteratorDirection::TextIteratorForward;
+
CharacterIteratorAlgorithm(const PositionTemplate<Strategy>& start, const PositionTemplate<Strategy>& end, TextIteratorBehaviorFlags = TextIteratorDefaultBehavior);
explicit CharacterIteratorAlgorithm(const EphemeralRangeTemplate<Strategy>&, TextIteratorBehaviorFlags = TextIteratorDefaultBehavior);
@@ -50,7 +54,7 @@ public:
bool atEnd() const { return m_textIterator.atEnd(); }
int length() const { return m_textIterator.length() - m_runOffset; }
- UChar characterAt(unsigned index) const { return m_textIterator.text().characterAt(m_runOffset + index); }
+ UChar characterAt(unsigned index) const { return m_textIterator.characterAt(m_runOffset + index); }
template<typename BufferType>
void appendTextTo(BufferType& output) { m_textIterator.copyTextTo(output, m_runOffset); }

Powered by Google App Engine
This is Rietveld 408576698