From cc699faa5484d584950a144635d699be41be0196 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 27 Jan 2015 13:11:32 +0000 Subject: Store direct ref_ptr for WordDB lines Storing a SharedString is a waste, we want the whole line. --- src/buffer.hh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/buffer.hh') diff --git a/src/buffer.hh b/src/buffer.hh index 9963b7cc..084af636 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -126,8 +126,8 @@ public: StringView operator[](LineCount line) const { return m_lines[line]; } - SharedString shared_line(LineCount line) const - { return m_lines.get_shared(line); } + ref_ptr line_storage(LineCount line) const + { return m_lines.get_storage(line); } // returns an iterator at given coordinates. clamp line_and_column BufferIterator iterator_at(ByteCoord coord) const; @@ -181,10 +181,6 @@ private: const ref_ptr& get_storage(LineCount line) const { return BufferLines::operator[]((int)line); } - [[gnu::always_inline]] - SharedString get_shared(LineCount line) const - { return SharedString{get_storage(line)}; } - [[gnu::always_inline]] StringView operator[](LineCount line) const { return get_storage(line)->strview(); } -- cgit v1.2.3