From da1cc7c3a56102a06b2484ea958bb4419467fbac Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 9 Jul 2020 08:45:41 +0200 Subject: [PATCH] [libcalamaresui] Don't clear the map when inserting strings - the documentation doesn't say the map is cleared, and the one place this function is used doesn't need that either. - make type of config explicit --- src/libcalamaresui/Branding.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libcalamaresui/Branding.cpp b/src/libcalamaresui/Branding.cpp index a5909fd61..cf66097c9 100644 --- a/src/libcalamaresui/Branding.cpp +++ b/src/libcalamaresui/Branding.cpp @@ -132,9 +132,7 @@ loadStrings( QMap< QString, QString >& map, throw YAML::Exception( YAML::Mark(), std::string( "Branding configuration is not a map: " ) + key ); } - const auto& config = CalamaresUtils::yamlMapToVariant( doc[ key ] ); - - map.clear(); + const QVariantMap config = CalamaresUtils::yamlMapToVariant( doc[ key ] ); for ( auto it = config.constBegin(); it != config.constEnd(); ++it ) { map.insert( it.key(), transform( it.value().toString() ) );