From patchwork Mon Apr 21 16:00:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 23202 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4B7E3C327D for ; Mon, 21 Apr 2025 16:00:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 71A1068AC8; Mon, 21 Apr 2025 18:00:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Jh6pkY8N"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1112268ABA for ; Mon, 21 Apr 2025 18:00:15 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 53A946D5 for ; Mon, 21 Apr 2025 17:58:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745251088; bh=FdAwkt3Rr8j7O3XR4nGIGOIEaS70WH28bDVnSeLx6bY=; h=From:To:Subject:Date:From; b=Jh6pkY8N8bbm68Sgts++XEWpx4qPddggKdxtP5acIJvBtCYxbR9p8qz8ro7I6cx8F Ckc4XF0x9AbXF8WOo25a8VzepXPPJYFhXytnRXjjpoKrowDs4dQdWqLUKcyt4BfWoc f77hlY1KCNKxzGWCIP+H7WeAx21kOBE67/WoWhwU= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: ipa_module: Avoid unnecessary copy when getting 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 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The `signature()` getter can just return a reference to the private vector member variable, and let the caller make a copy if needed. Since the return type is const qualified, this was likely the original intetion. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- include/libcamera/internal/ipa_module.h | 2 +- src/libcamera/ipa_module.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libcamera/internal/ipa_module.h b/include/libcamera/internal/ipa_module.h index 7c49d3f34..15f19492c 100644 --- a/include/libcamera/internal/ipa_module.h +++ b/include/libcamera/internal/ipa_module.h @@ -29,7 +29,7 @@ public: bool isValid() const; const struct IPAModuleInfo &info() const; - const std::vector signature() const; + const std::vector &signature() const; const std::string &path() const; bool load(); diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index 9ca74be6e..e6ea61e44 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -373,7 +373,7 @@ const struct IPAModuleInfo &IPAModule::info() const * * \return The IPA module signature */ -const std::vector IPAModule::signature() const +const std::vector &IPAModule::signature() const { return signature_; }