From 9bdc7b7d4b45e4cb30da258a37c0fe62e7e6906c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 31 Jul 2017 18:24:05 +0200 Subject: [PATCH] Do not move temporary objects It prevents copy elision according to Clang and of course clang is right. --- udev.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/udev.cpp b/udev.cpp index c1f219ce3c..aa4cea5c98 100644 --- a/udev.cpp +++ b/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))); } }