From af7ad964dd205a0731a8e62463272e546f690c2b Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 8 Jun 2024 21:21:02 +0100 Subject: [PATCH] Codechange: Avoid unnecessary allocation of temporaries in layout line cache (#12737) --- src/gfx_layout.cpp | 2 +- src/gfx_layout.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 392ba1fa4a..fbdfe10ec2 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -388,7 +388,7 @@ Layouter::LineCacheItem &Layouter::GetCachedParagraphLayout(std::string_view str LineCacheKey key; key.state_before = state; key.str.assign(str); - return (*linecache)[key]; + return (*linecache)[std::move(key)]; } /** diff --git a/src/gfx_layout.h b/src/gfx_layout.h index 42b809f561..f635d80dc3 100644 --- a/src/gfx_layout.h +++ b/src/gfx_layout.h @@ -132,7 +132,7 @@ class Layouter : public std::vector