From 35e64c44d88424fdab5261acc053365b73a7c5c0 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 8 Mar 2019 15:18:35 +0100 Subject: [PATCH] No & is a bit faster here --- src/imageformats/pcx.cpp | 4 ++-- src/imageformats/xcf.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/imageformats/pcx.cpp b/src/imageformats/pcx.cpp index ad12c85..a45ba96 100644 --- a/src/imageformats/pcx.cpp +++ b/src/imageformats/pcx.cpp @@ -23,7 +23,7 @@ public: quint8 g; quint8 b; - static RGB from(const QRgb &color) + static RGB from(const QRgb color) { RGB c; c.r = qRed(color); @@ -169,7 +169,7 @@ static QDataStream &operator>>(QDataStream &s, PCXHEADER &ph) return s; } -static QDataStream &operator<<(QDataStream &s, const RGB &rgb) +static QDataStream &operator<<(QDataStream &s, const RGB rgb) { s << rgb.r << rgb.g << rgb.b; diff --git a/src/imageformats/xcf.cpp b/src/imageformats/xcf.cpp index 43a7d80..d92f5e9 100644 --- a/src/imageformats/xcf.cpp +++ b/src/imageformats/xcf.cpp @@ -276,7 +276,7 @@ const XCFImageFormat::LayerModes XCFImageFormat::layer_modes[] = { }; //! Change a QRgb value's alpha only. -inline QRgb qRgba(const QRgb &rgb, int a) +inline QRgb qRgba(const QRgb rgb, int a) { return ((a & 0xff) << 24 | (rgb & RGB_MASK)); }