Fix unnecessary buffer line copy in BufferManager::create_buffer

This commit is contained in:
Maxime Coste 2024-02-28 20:54:37 +11:00
parent 068af3d9d4
commit b8a151ab46

View File

@ -34,7 +34,7 @@ Buffer* BufferManager::create_buffer(String name, Buffer::Flags flags, BufferLin
throw runtime_error{"buffer name is already in use"}; throw runtime_error{"buffer name is already in use"};
} }
m_buffers.push_back(std::make_unique<Buffer>(std::move(name), flags, lines, bom, eolformat, fs_status)); m_buffers.push_back(std::make_unique<Buffer>(std::move(name), flags, std::move(lines), bom, eolformat, fs_status));
auto* buffer = m_buffers.back().get(); auto* buffer = m_buffers.back().get();
buffer->on_registered(); buffer->on_registered();