diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h index 02412066a8..72198b75f3 100644 --- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h +++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h @@ -164,8 +164,7 @@ public: bool registerObject() { - const auto copy = m_connections; // needed? Loop doesn't modify, but handleConnection() does - for (const QString &name : copy) { + for (const QString &name : std::as_const(m_connections)) { if (!registerObject(QDBusConnection(name))) return false; } @@ -174,8 +173,7 @@ public: void unregisterObject() { - const auto copy = m_connections; // needed? Loop doesn't modify, but handleConnection() does - for (const QString &name : copy) { + for (const QString &name : std::as_const(m_connections)) { QDBusConnection c(name); c.unregisterObject(m_path); }