From da9d5a47bcb8ecfab2b32dce4c208293a88aa0aa Mon Sep 17 00:00:00 2001 From: bad code <> Date: Sun, 22 Sep 2024 16:43:56 +0200 Subject: [PATCH] Avoid copies in loop iterator --- src/btop_config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/btop_config.cpp b/src/btop_config.cpp index 55ef2ca..41a261b 100644 --- a/src/btop_config.cpp +++ b/src/btop_config.cpp @@ -758,7 +758,7 @@ namespace Config { std::ofstream cwrite(conf_file, std::ios::trunc); if (cwrite.good()) { cwrite << "#? Config file for btop v. " << Global::Version << "\n"; - for (auto [name, description] : descriptions) { + for (const auto& [name, description] : descriptions) { cwrite << "\n" << (description.empty() ? "" : description + "\n") << name << " = "; if (strings.contains(name))