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.hh13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/utf8_iterator.hh b/src/utf8_iterator.hh
index 9d10df2a..0467c30e 100644
--- a/src/utf8_iterator.hh
+++ b/src/utf8_iterator.hh
@@ -38,7 +38,6 @@ public:
iterator& operator++() noexcept
{
utf8::to_next(m_it, m_end);
- invalidate_value();
return *this;
}
@@ -52,7 +51,6 @@ public:
iterator& operator--() noexcept
{
utf8::to_previous(m_it, m_begin);
- invalidate_value();
return *this;
}
@@ -127,7 +125,7 @@ public:
CodepointType operator*() const noexcept(noexcept_policy)
{
- return get_value();
+ return (CodepointType)utf8::codepoint<InvalidPolicy>(m_it, m_end);
}
CodepointType read() noexcept(noexcept_policy)
@@ -138,18 +136,9 @@ public:
const BaseIt& base() const noexcept(noexcept_policy) { return m_it; }
private:
- void invalidate_value() noexcept { m_value = -1; }
- CodepointType get_value() const noexcept(noexcept_policy)
- {
- if (m_value == (CodepointType)-1)
- m_value = (CodepointType)utf8::codepoint<InvalidPolicy>(m_it, m_end);
- return m_value;
- }
-
BaseIt m_it;
Sentinel m_begin;
Sentinel m_end;
- mutable CodepointType m_value = -1;
};
}