Avoid needless string comparison

by inlining and reordering the condition.

Change-Id: I68a91e75071975a4cc26333094db3433afbaeb72
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
This commit is contained in:
Konstantin Ritt 2015-12-10 14:26:05 +04:00
parent 088eef5756
commit f5e02d4128

View File

@ -945,9 +945,10 @@ QFontEngine *loadSingleEngine(int script,
// If the font data's native stretch matches the requested stretch we need to set stretch to 100
// to avoid the fontengine synthesizing stretch. If they didn't match exactly we need to calculate
// the new stretch factor. This only done if not matched by styleName.
bool styleNameMatch = !request.styleName.isEmpty() && request.styleName == style->styleName;
if (!styleNameMatch && style->key.stretch != 0 && request.stretch != 0)
if (style->key.stretch != 0 && request.stretch != 0
&& (request.styleName.isEmpty() || request.styleName != style->styleName)) {
def.stretch = (request.stretch * 100 + 50) / style->key.stretch;
}
engine = pfdb->fontEngine(def, size->handle);
if (engine) {