diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-08-22 10:35:44 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2021-08-24 13:39:06 +0200 |
commit | f6b851837df08b3f2fc6a571a2cc4567471a2495 (patch) | |
tree | 35bc669e27be82abb8834ebeba1017c9eda48227 /src | |
parent | 01aeb5f7e4fd977e9698fffdc7650897664ecb82 (diff) |
Fix warning about loop variable creating a copy
qxpmhandler.cpp:1162:21: warning: loop variable '[color, index]' of type
'const std::__1::pair<const unsigned int, int>' creates a copy from type
'const std::__1::pair<const unsigned int, int>' [-Wrange-loop-analysis]
for (const auto [color, index] : colorMap)
^
Change-Id: Ifabf1c569efdcd929859227d860f4598250ba5bd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qxpmhandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index da975869d5..b9b0f443fa 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -1159,7 +1159,7 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const << '\"' << w << ' ' << h << ' ' << ncolors << ' ' << cpp << '\"'; // write palette - for (const auto [color, index] : colorMap) { + for (const auto &[color, index] : colorMap) { const QString line = image.format() != QImage::Format_RGB32 && !qAlpha(color) ? QString::asprintf("\"%s c None\"", xpm_color_name(cpp, index)) : QString::asprintf("\"%s c #%02x%02x%02x\"", xpm_color_name(cpp, index), |