Do not move temporary objects
It prevents copy elision according to Clang and of course clang is right.
This commit is contained in:
parent
f15ceaffe6
commit
9bdc7b7d4b
1 changed files with 3 additions and 3 deletions
6
udev.cpp
6
udev.cpp
|
@ -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)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue