Optimize QFont::resolve(const QFont &other)

When resolve_mask is 0, the font inherits just everything, and there is
no need in checking for any resolved attributes;
the resolved font always inherits dpi, so do not check it either.

Change-Id: Ie5d7ced0859d46a9237447e29051a22569480a51
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
bb10
Konstantin Ritt 2015-04-22 05:28:08 +04:00
parent a37daf99ad
commit 7443b3c949
1 changed files with 2 additions and 4 deletions

View File

@ -1724,10 +1724,8 @@ bool QFont::rawMode() const
*/
QFont QFont::resolve(const QFont &other) const
{
if (*this == other
&& (resolve_mask == other.resolve_mask || resolve_mask == 0)
&& d->dpi == other.d->dpi) {
QFont o = other;
if (resolve_mask == 0 || (resolve_mask == other.resolve_mask && *this == other)) {
QFont o(other);
o.resolve_mask = resolve_mask;
return o;
}