Avoid copies in loop iterator

This commit is contained in:
bad code
2024-09-22 16:43:56 +02:00
committed by Steffen
parent 46d160e91a
commit da9d5a47bc

View File

@@ -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))