[libcalamares] Reduce copying and warnings

main
Adriaan de Groot 6 years ago
parent 5279e78c9f
commit 2777b5dd30

@ -66,7 +66,7 @@ struct NamedEnumTable
{ {
ok = false; ok = false;
for ( const auto p : table ) for ( const auto& p : table )
if ( 0 == QString::compare( s, p.first, Qt::CaseInsensitive ) ) if ( 0 == QString::compare( s, p.first, Qt::CaseInsensitive ) )
{ {
ok = true; ok = true;
@ -87,7 +87,7 @@ struct NamedEnumTable
{ {
ok = false; ok = false;
for ( const auto p : table ) for ( const auto &p : table )
if ( s == p.second) if ( s == p.second)
{ {
ok = true; ok = true;

@ -72,7 +72,7 @@ public:
NamedSuffix( const NamedEnumTable<T>& table, const QString& s ) NamedSuffix( const NamedEnumTable<T>& table, const QString& s )
: NamedSuffix() : NamedSuffix()
{ {
for( const auto suffix : table.table ) for( const auto& suffix : table.table )
if ( s.endsWith( suffix.first ) ) if ( s.endsWith( suffix.first ) )
{ {
m_value = s.left( s.length() - suffix.first.length() ).toInt(); m_value = s.left( s.length() - suffix.first.length() ).toInt();

Loading…
Cancel
Save