summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-04-03 19:22:12 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-04-04 14:04:37 +0200
commit1fd99e7e88c48d503a07b8a53580622467ae407f (patch)
tree878121c0581af6ea4879c01f22a559480ab0bbfc /src/buffer.cc
parent4fbe2dc6bc2522e79558fcb1af19d0cad947ea83 (diff)
do not check buffer invariant in do_{erase,insert} as this cause O(n²) behaviour
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/buffer.cc b/src/buffer.cc
index c8ad73c0..cce72005 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -321,8 +321,6 @@ void Buffer::do_insert(const BufferIterator& pos, const String& content)
end_it = BufferIterator{*this, { last_line, m_lines[last_line].length() - suffix.length() }};
}
- check_invariant();
-
for (auto listener : m_change_listeners)
listener->on_insert(begin_it, end_it);
}
@@ -348,8 +346,6 @@ void Buffer::do_erase(const BufferIterator& begin, const BufferIterator& end)
for (LineCount i = begin.line()+1; i < line_count(); ++i)
m_lines[i].start -= length;
- check_invariant();
-
for (auto listener : m_change_listeners)
listener->on_erase(begin, end);
}