libcamera: device_enumerator: Remove unnecessary rvalue references

There are std::unique_ptr rvalue reference arguments. They are
intended to pass the ownership to the functions. In the case,
it is right to let the argument be std::unique_ptr value and
pass by std::move().

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Hirokazu Honda
2021-03-23 07:09:10 +09:00
committed by Laurent Pinchart
parent 5154e14b3e
commit 67e791373d
3 changed files with 4 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ public:
protected:
std::unique_ptr<MediaDevice> createDevice(const std::string &deviceNode);
void addDevice(std::unique_ptr<MediaDevice> &&media);
void addDevice(std::unique_ptr<MediaDevice> media);
void removeDevice(const std::string &deviceNode);
private:

View File

@@ -39,8 +39,8 @@ private:
using DependencyMap = std::map<dev_t, std::list<MediaEntity *>>;
struct MediaDeviceDeps {
MediaDeviceDeps(std::unique_ptr<MediaDevice> &&media,
DependencyMap &&deps)
MediaDeviceDeps(std::unique_ptr<MediaDevice> media,
DependencyMap deps)
: media_(std::move(media)), deps_(std::move(deps))
{
}

View File

@@ -246,7 +246,7 @@ std::unique_ptr<MediaDevice> DeviceEnumerator::createDevice(const std::string &d
* This method shall be called after all members of the entities of the
* media graph have been confirmed to be initialized.
*/
void DeviceEnumerator::addDevice(std::unique_ptr<MediaDevice> &&media)
void DeviceEnumerator::addDevice(std::unique_ptr<MediaDevice> media)
{
LOG(DeviceEnumerator, Debug)
<< "Added device " << media->deviceNode() << ": " << media->driver();