diff options
| author | Maxime Coste <mawww@kakoune.org> | 2025-02-04 19:22:03 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2025-02-04 19:22:03 +1100 |
| commit | 3ff33830627438de3f9638c18f7e192cdf5b32a5 (patch) | |
| tree | c64cac49bd3e04772633e2a4d025a73760048136 /src/buffer.cc | |
| parent | 8eb753adfd914b0deade48c7510e30f7e05df860 (diff) | |
Revert "WIP linked list shared strings"
This got pushed by accident
This reverts commit 2856b99e0914cc7a659977f2b33308cb5b4c9bb7.
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/buffer.cc b/src/buffer.cc index 0b943207..f0205c54 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -20,23 +20,6 @@ namespace Kakoune { -void fix_links(BufferLines& lines, StringData* sentinel) -{ - StringData* prev = nullptr; - for (auto& ptr : lines) - { - ptr->prev = prev; - if (prev) - prev->next = ptr.get(); - prev = ptr.get(); - } - if (prev) - { - prev->next = sentinel; - sentinel->prev = prev; - } -} - Buffer::HistoryNode::HistoryNode(HistoryId parent) : parent{parent}, committed{Clock::now()} {} @@ -59,7 +42,6 @@ Buffer::Buffer(String name, Flags flags, BufferLines lines, line->data()[line->length-1] == '\n'); #endif static_cast<BufferLines&>(m_lines) = std::move(lines); - fix_links(m_lines, m_sentinel.get()); m_changes.push_back({ Change::Insert, {0,0}, line_count() }); @@ -289,7 +271,6 @@ void Buffer::reload(BufferLines lines, ByteOrderMark bom, EolFormat eolformat, F m_lines.erase(write_it, m_lines.end()); } - fix_links(m_lines, m_sentinel.get()); commit_undo_group(); options().get_local_option("eolformat").set(eolformat); @@ -471,7 +452,6 @@ BufferRange Buffer::do_insert(BufferCoord pos, StringView content) const auto end = at_end ? line_count() : BufferCoord{ last_line, m_lines[last_line].length() - suffix.length() }; - fix_links(m_lines, m_sentinel.get()); m_changes.push_back({ Change::Insert, pos, end }); return {pos, end}; } @@ -493,7 +473,6 @@ BufferCoord Buffer::do_erase(BufferCoord begin, BufferCoord end) if (new_line) m_lines.get_storage(begin.line) = std::move(new_line); - fix_links(m_lines, m_sentinel.get()); return begin; } |
