From 2777b5dd30071d8ffe837833eb0a27f1c51a4a3d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 11 Apr 2019 13:26:02 +0200 Subject: [PATCH] [libcalamares] Reduce copying and warnings --- src/libcalamares/utils/NamedEnum.h | 4 ++-- src/libcalamares/utils/NamedSuffix.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcalamares/utils/NamedEnum.h b/src/libcalamares/utils/NamedEnum.h index 047ae6f19..b4c7dcd56 100644 --- a/src/libcalamares/utils/NamedEnum.h +++ b/src/libcalamares/utils/NamedEnum.h @@ -66,7 +66,7 @@ struct NamedEnumTable { ok = false; - for ( const auto p : table ) + for ( const auto& p : table ) if ( 0 == QString::compare( s, p.first, Qt::CaseInsensitive ) ) { ok = true; @@ -87,7 +87,7 @@ struct NamedEnumTable { ok = false; - for ( const auto p : table ) + for ( const auto &p : table ) if ( s == p.second) { ok = true; diff --git a/src/libcalamares/utils/NamedSuffix.h b/src/libcalamares/utils/NamedSuffix.h index 97568d1da..d4a0ed4b7 100644 --- a/src/libcalamares/utils/NamedSuffix.h +++ b/src/libcalamares/utils/NamedSuffix.h @@ -72,7 +72,7 @@ public: NamedSuffix( const NamedEnumTable& table, const QString& s ) : NamedSuffix() { - for( const auto suffix : table.table ) + for( const auto& suffix : table.table ) if ( s.endsWith( suffix.first ) ) { m_value = s.left( s.length() - suffix.first.length() ).toInt();