summaryrefslogtreecommitdiff
path: root/src/utf8_iterator.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/utf8_iterator.hh')
-rw-r--r--src/utf8_iterator.hh19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/utf8_iterator.hh b/src/utf8_iterator.hh
index 1e359f17..43242a73 100644
--- a/src/utf8_iterator.hh
+++ b/src/utf8_iterator.hh
@@ -36,12 +36,6 @@ public:
return save;
}
- void advance(CharCount count, const iterator& end)
- {
- while (*this != end and count-- > 0)
- ++*this;
- }
-
iterator& operator--()
{
m_it = utf8::previous(m_it, Iterator{});
@@ -101,18 +95,9 @@ public:
return m_it >= other.m_it;
}
- CharCount operator-(iterator other) const
+ CharCount operator-(const iterator& other) const
{
- //kak_assert(other < *this);
- check_invariant();
- other.check_invariant();
- CharCount dist = 0;
- while (other.m_it < m_it)
- {
- ++dist;
- ++other;
- }
- return dist;
+ return utf8::distance(other.m_it, m_it);
}
Codepoint operator*() const