From 3d5a0c672e6f3cf87944b33712e17531aa42c607 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 28 Feb 2024 19:00:51 +1100 Subject: Templatize StringData::create This improves performance by letting the compiler optimize most use cases where string count and length are known are compile time. --- src/buffer_manager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/buffer_manager.cc') diff --git a/src/buffer_manager.cc b/src/buffer_manager.cc index 32d03fc1..22ccf366 100644 --- a/src/buffer_manager.cc +++ b/src/buffer_manager.cc @@ -83,8 +83,8 @@ Buffer& BufferManager::get_first_buffer() { if (all_of(m_buffers, [](auto& b) { return (b->flags() & Buffer::Flags::Debug); })) create_buffer("*scratch*", Buffer::Flags::None, - {StringData::create({"*** this is a *scratch* buffer which won't be automatically saved ***\n"}), - StringData::create({"*** use it for notes or open a file buffer with the :edit command ***\n"})}, + {StringData::create("*** this is a *scratch* buffer which won't be automatically saved ***\n"), + StringData::create("*** use it for notes or open a file buffer with the :edit command ***\n")}, ByteOrderMark::None, EolFormat::Lf, {InvalidTime, {}, {}}); return *m_buffers.back(); -- cgit v1.2.3