Do not move temporary objects

It prevents copy elision according to Clang and of course clang is
right.
icc-effect-5.14.5
Martin Gräßlin 2017-07-31 18:24:05 +02:00
parent f15ceaffe6
commit 9bdc7b7d4b
1 changed files with 3 additions and 3 deletions

View File

@ -180,7 +180,7 @@ UdevDevice::Ptr Udev::renderNode()
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()
@ -285,9 +285,9 @@ void UdevMonitor::enable()
UdevDevice::Ptr UdevMonitor::getDevice()
{
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)));
}
}