[libcalamares] Reduce copying and warnings

This commit is contained in:
Adriaan de Groot 2019-04-11 13:26:02 +02:00
parent 5279e78c9f
commit 2777b5dd30
2 changed files with 3 additions and 3 deletions

View File

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

View File

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