Don't move local object in return statement

Clang complains that this prevents copy elision.
icc-effect-5.14.5
Martin Flöser 2017-08-19 14:10:59 +02:00
parent 70bc9524d9
commit 95a6f1ac2a
1 changed files with 2 additions and 2 deletions

View File

@ -116,13 +116,13 @@ UdevDevice::Ptr UdevEnumerate::find(std::function<bool(const UdevDevice::Ptr &de
continue;
}
if (test(device)) {
return std::move(device);
return device;
}
if (!firstFound) {
firstFound.swap(device);
}
}
return std::move(firstFound);
return firstFound;
}
UdevDevice::Ptr Udev::primaryGpu()