QtWidgets: Use strcmp instead of equality operator

Addressing some findings from the review of QTBUG-98434, use strcmp
instead of the equality operator. This saves one strlen() per QL1SV
constructor and takes L1 out of the picture.

Task-number: QTBUG-103100
Change-Id: Iffe8ce4c4dd9a3ee590d4bb8a14b950241b835e2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Mate Barany 2022-09-19 15:39:13 +02:00
parent 12ff1888b1
commit b66f8e0738
3 changed files with 3 additions and 9 deletions

View File

@ -1887,9 +1887,7 @@ bool QColorDialogPrivate::canBeNativeDialog() const
return false;
}
QLatin1StringView staticName(QColorDialog::staticMetaObject.className());
QLatin1StringView dynamicName(q->metaObject()->className());
return (staticName == dynamicName);
return strcmp(QColorDialog::staticMetaObject.className(), q->metaObject()->className()) == 0;
}
static const Qt::WindowFlags DefaultWindowFlags =

View File

@ -690,9 +690,7 @@ bool QFileDialogPrivate::canBeNativeDialog() const
return false;
}
QLatin1StringView staticName(QFileDialog::staticMetaObject.className());
QLatin1StringView dynamicName(q->metaObject()->className());
return (staticName == dynamicName);
return strcmp(QFileDialog::staticMetaObject.className(), q->metaObject()->className()) == 0;
}
bool QFileDialogPrivate::usingWidgets() const

View File

@ -1017,9 +1017,7 @@ bool QFontDialogPrivate::canBeNativeDialog() const
return false;
}
QLatin1StringView staticName(QFontDialog::staticMetaObject.className());
QLatin1StringView dynamicName(q->metaObject()->className());
return (staticName == dynamicName);
return strcmp(QFontDialog::staticMetaObject.className(), q->metaObject()->className()) == 0;
}
QT_END_NAMESPACE