summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
authorMate Barany <mate.barany@qt.io>2022-09-19 15:39:13 +0200
committerMate Barany <mate.barany@qt.io>2022-09-26 13:02:38 +0200
commitb66f8e0738d9fcb4bf281e2f2b6d81d828f13465 (patch)
tree07b05dfcc151ca1b9cd4c7869869c11cbfec1b91 /src/widgets/dialogs
parent12ff1888b16d91db9227d856d38d9b5740f7e191 (diff)
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>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp4
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp4
-rw-r--r--src/widgets/dialogs/qfontdialog.cpp4
3 files changed, 3 insertions, 9 deletions
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index e3265278c0..e9c7c0a514 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -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 =
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index a6bd0fb19e..6b326591a0 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -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
diff --git a/src/widgets/dialogs/qfontdialog.cpp b/src/widgets/dialogs/qfontdialog.cpp
index 26e9212a95..af12157065 100644
--- a/src/widgets/dialogs/qfontdialog.cpp
+++ b/src/widgets/dialogs/qfontdialog.cpp
@@ -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