From 6da3c3e200b0c78930da3b58c4beedd194446f57 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 22 May 2023 17:18:43 +0200 Subject: [PATCH] Fix a gcc warning about copy ``` /home/jvoisin/dev/openmw/openmw/components/fontloader/fontloader.cpp:532:29: warning: loop variable '[key, value]' creates a copy from type 'std::pair const' [-Wrange-loop-construct] for (const auto [key, value] : additional) ^ /home/jvoisin/dev/openmw/openmw/components/fontloader/fontloader.cpp:532:18: note: use reference type 'std::pair const &' to prevent copying for (const auto [key, value] : additional) ^~~~~~~~~~~~~~~~~~~~~~~~~ & 1 warning generated. ``` --- components/fontloader/fontloader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/fontloader/fontloader.cpp b/components/fontloader/fontloader.cpp index 0c2b62f821..923e699d43 100644 --- a/components/fontloader/fontloader.cpp +++ b/components/fontloader/fontloader.cpp @@ -529,7 +529,7 @@ namespace Gui additional.insert(std::make_pair(84, 0x2122)); // trademark sign additional.insert(std::make_pair(45, 0x2212)); // minus sign - for (const auto [key, value] : additional) + for (const auto& [key, value] : additional) { if (key != i) continue;