Patch Detail
Show a patch.
GET /api/1.1/patches/2648/?format=api
{ "id": 2648, "url": "https://patchwork.libcamera.org/api/1.1/patches/2648/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2648/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200114201452.14078-1-laurent.pinchart@ideasonboard.com>", "date": "2020-01-14T20:14:52", "name": "[libcamera-devel] libcamera: Remove std::piecewise_construct where not necessary", "commit_ref": "38dd90307ab2b0d25a0a233eae04455f769153b4", "pull_url": null, "state": "accepted", "archived": false, "hash": "f4b2979dcf4817ad1fe25146827aaf751187213f", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2648/mbox/", "series": [ { "id": 626, "url": "https://patchwork.libcamera.org/api/1.1/series/626/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=626", "date": "2020-01-14T20:14:52", "name": "[libcamera-devel] libcamera: Remove std::piecewise_construct where not necessary", "version": 1, "mbox": "https://patchwork.libcamera.org/series/626/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2648/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2648/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5BBF26074F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jan 2020 21:15:08 +0100 (CET)", "from pendragon.ideasonboard.com\n\t(cpc108967-cmbg20-2-0-cust420.5-4.cable.virginm.net [81.101.7.165])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9EDD02D2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jan 2020 21:15:07 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1579032908;\n\tbh=7dlhlvI0OVOJAmF+Jtxhr+H8kdmIzNwt/mATHPs8BeI=;\n\th=From:To:Subject:Date:From;\n\tb=NAl+Pbaw285HuR+ZFhKu4SDgwd1Bdg0gYePwTTdDy/OsAx9EvNXB4ecrSFNFSrHua\n\tur5mmHlpWcjpdhiPp4qIDu/DIqzrg8vNxuZ1y0bgnXoqIASJ7WsOxe+DznSXl3jkmz\n\tBLXR5GKhoubvMsn/ANOHPRRvIgw33ljV4NqLDqAQ=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 14 Jan 2020 22:14:52 +0200", "Message-Id": "<20200114201452.14078-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.24.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: Remove\n\tstd::piecewise_construct where not necessary", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Tue, 14 Jan 2020 20:15:08 -0000" }, "content": "When emplacing an element in a std::map, std::piecewise_construct is\nrequired to forward the parameters to the constructors of the key and\nmapped type, respectively. However, when the caller already has an\ninstance of the mapped type, forwarding it to the mapped type copy\nconstructor isn't really required, as the copy constructor would be\ncalled anyway. Drop std::piecewise_construct in those cases. This does\nnot incur any performance cost.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/uvcvideo.cpp | 4 +---\n src/libcamera/pipeline/vimc.cpp | 4 +---\n 2 files changed, 2 insertions(+), 6 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp\nindex 83093676ec73..29afb121aa46 100644\n--- a/src/libcamera/pipeline/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo.cpp\n@@ -365,9 +365,7 @@ int UVCCameraData::init(MediaEntity *entity)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tctrls.emplace(std::piecewise_construct,\n-\t\t\t std::forward_as_tuple(id),\n-\t\t\t std::forward_as_tuple(range));\n+\t\tctrls.emplace(id, range);\n \t}\n \n \tcontrolInfo_ = std::move(ctrls);\ndiff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex c99560a45cfa..b1054d307ea2 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -448,9 +448,7 @@ int VimcCameraData::init(MediaDevice *media)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tctrls.emplace(std::piecewise_construct,\n-\t\t\t std::forward_as_tuple(id),\n-\t\t\t std::forward_as_tuple(range));\n+\t\tctrls.emplace(id, range);\n \t}\n \n \tcontrolInfo_ = std::move(ctrls);\n", "prefixes": [ "libcamera-devel" ] }