Commit 95a6f1ac authored by Martin Flöser's avatar Martin Flöser

Don't move local object in return statement

Clang complains that this prevents copy elision.
parent 70bc9524
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment