From db347ec2f8949da0bcbc28f2d2c43c213bd89cfe Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Fri, 30 Mar 2012 22:33:05 +0200 Subject: Return early in QRawFont::setPixelSize. We would otherwise end up cloning the font engine for absolutely no reason when the pixel size is already right. Change-Id: I8c34d2b53b596ad49d00031a3fb8e79f3b30d591 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qrawfont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 9fbeef4685..5cdd563a33 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -672,7 +672,7 @@ QRawFont QRawFont::fromFont(const QFont &font, QFontDatabase::WritingSystem writ */ void QRawFont::setPixelSize(qreal pixelSize) { - if (d->fontEngine == 0) + if (d->fontEngine == 0 || qFuzzyCompare(d->fontEngine->fontDef.pixelSize, pixelSize)) return; d.detach(); -- cgit v1.2.3