diff --git a/src/udev.cpp b/src/udev.cpp index c35f0560de..c68a5724ac 100644 --- a/src/udev.cpp +++ b/src/udev.cpp @@ -98,11 +98,10 @@ void UdevEnumerate::scan() std::vector UdevEnumerate::find() { - std::vector vect; if (m_enumerate.isNull()) { - vect.push_back( UdevDevice::Ptr() ); - return vect; + return {}; } + std::vector vect; QString defaultSeat = QStringLiteral("seat0"); udev_list_entry *it = udev_enumerate_get_list_entry(m_enumerate.data()); while (it) { @@ -127,9 +126,7 @@ std::vector UdevEnumerate::find() std::vector Udev::listGPUs() { if (!m_udev) { - std::vector vect; - vect.push_back(UdevDevice::Ptr()); - return vect; + return {}; } #if defined(Q_OS_FREEBSD) std::vector r; @@ -159,9 +156,7 @@ std::vector Udev::listGPUs() std::vector Udev::listFramebuffers() { if (!m_udev) { - std::vector vect; - vect.push_back(UdevDevice::Ptr()); - return vect; + return {}; } UdevEnumerate enumerate(this); enumerate.addMatch(UdevEnumerate::Match::SubSystem, "graphics");