QWidget: micro-optimisation

Compare string size before content.

Change-Id: I00f9c6c6cf31148af4807455fa6f6b9254dda9d7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
bb10
Marc Mutz 2012-12-10 14:43:48 +01:00 committed by The Qt Project
parent c400e16a58
commit 2f531d8db3
1 changed files with 1 additions and 1 deletions

View File

@ -8259,7 +8259,7 @@ bool QWidget::event(QEvent *event)
#ifndef QT_NO_PROPERTIES
case QEvent::DynamicPropertyChange: {
const QByteArray &propName = static_cast<QDynamicPropertyChangeEvent *>(event)->propertyName();
if (!qstrncmp(propName, "_q_customDpi", 12) && propName.length() == 13) {
if (propName.length() == 13 && !qstrncmp(propName, "_q_customDpi", 12)) {
uint value = property(propName.constData()).toUInt();
if (!d->extra)
d->createExtra();