Do not move temporary objects

It prevents copy elision according to Clang and of course clang is
right.
This commit is contained in:
Martin Gräßlin 2017-07-31 18:24:05 +02:00
parent f15ceaffe6
commit 9bdc7b7d4b

View file

@ -180,7 +180,7 @@ UdevDevice::Ptr Udev::renderNode()
UdevDevice::Ptr Udev::deviceFromSyspath(const char *syspath) UdevDevice::Ptr Udev::deviceFromSyspath(const char *syspath)
{ {
return std::move(UdevDevice::Ptr(new UdevDevice(udev_device_new_from_syspath(m_udev, syspath)))); return UdevDevice::Ptr(new UdevDevice(udev_device_new_from_syspath(m_udev, syspath)));
} }
UdevMonitor *Udev::monitor() UdevMonitor *Udev::monitor()
@ -285,9 +285,9 @@ void UdevMonitor::enable()
UdevDevice::Ptr UdevMonitor::getDevice() UdevDevice::Ptr UdevMonitor::getDevice()
{ {
if (!m_monitor) { if (!m_monitor) {
return std::move(UdevDevice::Ptr()); return UdevDevice::Ptr();
} }
return std::move(UdevDevice::Ptr(new UdevDevice(udev_monitor_receive_device(m_monitor)))); return UdevDevice::Ptr(new UdevDevice(udev_monitor_receive_device(m_monitor)));
} }
} }