summaryrefslogtreecommitdiff
path: root/src/buffer.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-01-27 13:11:32 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-01-27 13:12:52 +0000
commitcc699faa5484d584950a144635d699be41be0196 (patch)
tree05d5a14c826e84716ace1854066fd31bc6ca18d7 /src/buffer.hh
parentfb98ff652dbe48d51a53f96c5ff99c09fff008bb (diff)
Store direct ref_ptr<StringStorage> for WordDB lines
Storing a SharedString is a waste, we want the whole line.
Diffstat (limited to 'src/buffer.hh')
-rw-r--r--src/buffer.hh8
1 files changed, 2 insertions, 6 deletions
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<StringStorage> 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;
@@ -182,10 +182,6 @@ private:
{ 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(); }