From: Ivailo Monev Date: Wed, 25 Mar 2020 18:51:28 +0000 (+0000) Subject: replace inline if with switch in QColormap::size() statement X-Git-Tag: 4.12.0~3899 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6cf4cf8185038f1701ef2230f97032f84f75406b;p=kde%2FKatie.git replace inline if with switch in QColormap::size() statement Signed-off-by: Ivailo Monev --- diff --git a/src/gui/painting/qcolormap_x11.cpp b/src/gui/painting/qcolormap_x11.cpp index 752c3ac45..4ede583c9 100644 --- a/src/gui/painting/qcolormap_x11.cpp +++ b/src/gui/painting/qcolormap_x11.cpp @@ -599,11 +599,15 @@ int QColormap::depth() const int QColormap::size() const { - return (d->mode == Gray - ? d->r_max - : (d->mode == Indexed - ? d->r_max * d->g_max * d->b_max - : -1)); + switch (d->mode) { + case Gray: + return d->r_max; + case Indexed: + return d->r_max * d->g_max * d->b_max; + case Direct: + return -1; + } + Q_UNREACHABLE(); } uint QColormap::pixel(const QColor &color) const