diff options
author | Marc Mutz <marc.mutz@qt.io> | 2024-02-20 11:15:10 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2024-02-22 07:16:53 +0100 |
commit | 05f9996bbf45fc90e49ea8c1679fa25201555860 (patch) | |
tree | 4db28fe7f296b4982ca5d1a90a3cfe00da1bf7cc /src/dbus | |
parent | 364e1c5f3042fdf0e530d08150f505b2f6aedc23 (diff) |
QDBusUtil::isValidBusName(): remove an impossible condition guard
QStringView::split() only returns an empty container if a) the haystack
is empty and b) SkipEmptyParts is in effect.
Neither is the case here: We use the implicit default of KeepEmptyParts,
and we've already checked that the haystack isn't empty in the first
line of the function.
So the result of split() can never be empty here. Remove the check to
avoid confusing more readers than just yours truly.
Amends the start of the public history.
Pick-to: 6.7 6.6 6.5
Change-Id: I423e747ae4de0708d063a6bb2befd625dbd5c591
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbusutil.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/dbus/qdbusutil.cpp b/src/dbus/qdbusutil.cpp index 78d225109a..6eee371305 100644 --- a/src/dbus/qdbusutil.cpp +++ b/src/dbus/qdbusutil.cpp @@ -392,9 +392,6 @@ namespace QDBusUtil return isValidUniqueConnectionName(busName); const auto parts = QStringView{busName}.split(u'.'); - if (parts.size() < 1) - return false; - for (QStringView part : parts) { if (part.isEmpty()) return false; |