diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-09-17 19:06:49 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-09-25 22:46:39 +1000 |
| commit | 2eccbbbe6fe2589f9133b7e5702832e21b26e8cf (patch) | |
| tree | 7cc2a28e271d151ab11fd2194e7ce2d9d3717d78 /src/display_buffer.hh | |
| parent | f855deaf8b50e6ac6aa030d32769ac175ab75a2d (diff) | |
Avoid unnecessary allocations in NCursesUI::Window::draw calls
Pass an ArrayView<DisplayAtom> instead of a DisplayLine& so that
the newly common case of passing a single atom does not require
constructing a Vector.
Diffstat (limited to 'src/display_buffer.hh')
| -rw-r--r-- | src/display_buffer.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/display_buffer.hh b/src/display_buffer.hh index 045a1cc8..1c8fc53d 100644 --- a/src/display_buffer.hh +++ b/src/display_buffer.hh @@ -30,6 +30,9 @@ public: DisplayAtom(String str, Face face) : face(face), m_type(Text), m_text(std::move(str)) {} + explicit DisplayAtom(String str) + : DisplayAtom(std::move(str), Face{}) {} + StringView content() const; ColumnCount length() const; |
