Skip to content

Commit 0b2c012

Browse files
committed
小优化(编译期计算常量)
1 parent fa551a3 commit 0b2c012

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/imageutils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ FImage &FImage::verticalUniforBlur(int radius)
124124

125125
FImage &FImage::impulseNoise(double noiseRatio)
126126
{
127-
QRgb white = qRgba(255, 255, 255, 255);
128-
QRgb black = qRgba(0, 0, 0, 255);
127+
constexpr QRgb white = qRgba(255, 255, 255, 255);
128+
constexpr QRgb black = qRgba(0, 0, 0, 255);
129129
if (noiseRatio > 0.0 && noiseRatio < 1.0)
130130
{
131131
for (int x = 0; x < _qimage.width(); x++)

0 commit comments

Comments
 (0)