{"id":23202,"url":"https://patchwork.libcamera.org/api/1.1/patches/23202/?format=json","web_url":"https://patchwork.libcamera.org/patch/23202/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250421160011.178090-1-barnabas.pocze@ideasonboard.com>","date":"2025-04-21T16:00:11","name":"[v1] libcamera: ipa_module: Avoid unnecessary copy when getting signature","commit_ref":"f31da7272eb0d8dfcd551057b24b5ca4f6985713","pull_url":null,"state":"accepted","archived":false,"hash":"f278cc241bbcd8ce197a9d59f71fc07b00c1307b","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/1.1/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/23202/mbox/","series":[{"id":5137,"url":"https://patchwork.libcamera.org/api/1.1/series/5137/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5137","date":"2025-04-21T16:00:11","name":"[v1] libcamera: ipa_module: Avoid unnecessary copy when getting signature","version":1,"mbox":"https://patchwork.libcamera.org/series/5137/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/23202/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/23202/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 4B7E3C327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 21 Apr 2025 16:00:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 71A1068AC8;\n\tMon, 21 Apr 2025 18:00:16 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1112268ABA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Apr 2025 18:00:15 +0200 (CEST)","from pb-laptop.local (185.221.143.16.nat.pool.zt.hu\n\t[185.221.143.16])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 53A946D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Apr 2025 17:58:08 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Jh6pkY8N\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1745251088;\n\tbh=FdAwkt3Rr8j7O3XR4nGIGOIEaS70WH28bDVnSeLx6bY=;\n\th=From:To:Subject:Date:From;\n\tb=Jh6pkY8N8bbm68Sgts++XEWpx4qPddggKdxtP5acIJvBtCYxbR9p8qz8ro7I6cx8F\n\tCkc4XF0x9AbXF8WOo25a8VzepXPPJYFhXytnRXjjpoKrowDs4dQdWqLUKcyt4BfWoc\n\tf77hlY1KCNKxzGWCIP+H7WeAx21kOBE67/WoWhwU=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v1] libcamera: ipa_module: Avoid unnecessary copy when\n\tgetting signature","Date":"Mon, 21 Apr 2025 18:00:11 +0200","Message-ID":"<20250421160011.178090-1-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.49.0","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The `signature()` getter can just return a reference to the private vector\nmember variable, and let the caller make a copy if needed. Since the\nreturn type is const qualified, this was likely the original intetion.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n include/libcamera/internal/ipa_module.h | 2 +-\n src/libcamera/ipa_module.cpp            | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/include/libcamera/internal/ipa_module.h b/include/libcamera/internal/ipa_module.h\nindex 7c49d3f34..15f19492c 100644\n--- a/include/libcamera/internal/ipa_module.h\n+++ b/include/libcamera/internal/ipa_module.h\n@@ -29,7 +29,7 @@ public:\n \tbool isValid() const;\n \n \tconst struct IPAModuleInfo &info() const;\n-\tconst std::vector<uint8_t> signature() const;\n+\tconst std::vector<uint8_t> &signature() const;\n \tconst std::string &path() const;\n \n \tbool load();\ndiff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex 9ca74be6e..e6ea61e44 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -373,7 +373,7 @@ const struct IPAModuleInfo &IPAModule::info() const\n  *\n  * \\return The IPA module signature\n  */\n-const std::vector<uint8_t> IPAModule::signature() const\n+const std::vector<uint8_t> &IPAModule::signature() const\n {\n \treturn signature_;\n }\n","prefixes":["v1"]}