summaryrefslogtreecommitdiff
path: root/src/buffer.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-01-28 13:06:03 +0000
committerMaxime Coste <mawww@kakoune.org>2017-01-28 13:06:03 +0000
commit68b92b9ac119deaca719bed752a421779cb28e0a (patch)
treedae8f322da104740c30d891cbd12ecdfd11b6e6c /src/buffer.hh
parent072064407a6699d1168b7ac8919fea3056501a77 (diff)
Make BufferIterator only a bidirectional iterator
Distance computation is too expensive on BufferIterators to treat them as random access.
Diffstat (limited to 'src/buffer.hh')
-rw-r--r--src/buffer.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/buffer.hh b/src/buffer.hh
index c30f93f9..a43458d2 100644
--- a/src/buffer.hh
+++ b/src/buffer.hh
@@ -55,7 +55,9 @@ public:
using difference_type = ssize_t;
using pointer = const value_type*;
using reference = const value_type&;
- using iterator_category = std::random_access_iterator_tag;
+ // computing the distance between two iterator can be
+ // costly, so this is not strictly random access
+ using iterator_category = std::bidirectional_iterator_tag;
BufferIterator() : m_buffer(nullptr) {}
BufferIterator(const Buffer& buffer, BufferCoord coord);