From 719997f0abb4460e656ddc0235cc4ddbd7bc854e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 4 Nov 2015 00:58:56 +0000 Subject: [PATCH] Do not tag BufferIterator as random access Boost regex considers that random access means fast distance computation, which is not the case for BufferIterator where Buffer::distance is O(num lines between them) which can get big on large files. Fixes #462 --- src/buffer.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.hh b/src/buffer.hh index 581321bc..90c1bb11 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -24,7 +24,7 @@ public: using difference_type = size_t; using pointer = const value_type*; using reference = const value_type&; - using iterator_category = std::random_access_iterator_tag; + using iterator_category = std::bidirectional_iterator_tag; BufferIterator() : m_buffer(nullptr) {} BufferIterator(const Buffer& buffer, ByteCoord coord);