diff options
author | Ivan Komissarov <ABBAPOH@gmail.com> | 2018-10-21 12:10:53 +0200 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2018-10-21 18:15:09 +0000 |
commit | 07f79a8029674f47b92a04646df6dfa9cedf894f (patch) | |
tree | 3a4efc1403db02c3efe1088bad090f2c35746ce0 | |
parent | qdir: Fix a condition typo (diff) | |
download | qtbase-07f79a8029674f47b92a04646df6dfa9cedf894f.tar.xz qtbase-07f79a8029674f47b92a04646df6dfa9cedf894f.zip |
qimagescale: Get rid of the memset call
There is no need to call a memset as long as class is initialized with
new and default-constructor will initialize values.
Change-Id: I02f9ec524e32cb72713f6b5e37b60f3dec72fb28
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/gui/painting/qimagescale.cpp | 1 | ||||
-rw-r--r-- | src/gui/painting/qimagescale_p.h | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/painting/qimagescale.cpp b/src/gui/painting/qimagescale.cpp index 96da5e029c..8a5274bd37 100644 --- a/src/gui/painting/qimagescale.cpp +++ b/src/gui/painting/qimagescale.cpp @@ -239,7 +239,6 @@ static QImageScaleInfo* QImageScale::qimageCalcScaleInfo(const QImage &img, isi = new QImageScaleInfo; if (!isi) return 0; - memset(isi, 0, sizeof(QImageScaleInfo)); isi->xup_yup = (qAbs(dw) >= sw) + ((qAbs(dh) >= sh) << 1); diff --git a/src/gui/painting/qimagescale_p.h b/src/gui/painting/qimagescale_p.h index 415623a575..244d681718 100644 --- a/src/gui/painting/qimagescale_p.h +++ b/src/gui/painting/qimagescale_p.h @@ -61,10 +61,11 @@ QImage qSmoothScaleImage(const QImage &img, int w, int h); namespace QImageScale { struct QImageScaleInfo { - int *xpoints; - const unsigned int **ypoints; - int *xapoints, *yapoints; - int xup_yup; + int *xpoints{nullptr}; + const unsigned int **ypoints{nullptr}; + int *xapoints{nullptr}; + int *yapoints{nullptr}; + int xup_yup{0}; }; } |