From patchwork Mon Mar 3 15:26:16 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: 22908 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 E3F2EBD808 for ; Mon, 3 Mar 2025 15:26:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0E20868777; Mon, 3 Mar 2025 16:26:22 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="b2OzN8Kk"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4976D68772 for ; Mon, 3 Mar 2025 16:26:20 +0100 (CET) Received: from pb-laptop.local (185.221.143.4.nat.pool.zt.hu [185.221.143.4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CBEA92D5 for ; Mon, 3 Mar 2025 16:24:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1741015488; bh=Gj7vqcaWys7bGVQK26vq/PpS+wa6hByjYVNNRHoYlHo=; h=From:To:Subject:Date:From; b=b2OzN8KkCpKcqHjAlcDCr9eFZM1/t2AqdesRhIPbbv/3BsAEnaHufLyuj58x8ibTq WpYmk8iBh14vmbi4wQ76Lk7yAWln1AxLYcEb1YgKZWSqrslkWqjLqO2cEDYBqOks/L zgpIjEJhAhhvv/rRNZw2Pg/7Mk8fLCE5mx8Rpbgw= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] libcamera: media_object: Fix unnecessary copy Date: Mon, 3 Mar 2025 16:26:16 +0100 Message-ID: <20250303152616.739193-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.48.1 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" `MediaEntity::ancillaryEntities()` can just return a const lvalue reference to the underlying array, a copy need not be made. That was likely the original intention. Fixes: 9490c664b57a6c ("libcamera: Add members to MediaEntity to support ancillary entities") Signed-off-by: Barnabás Pőcze Reviewed-by: Daniel Scally Reviewed-by: Laurent Pinchart --- include/libcamera/internal/media_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index 9356d204d..54e2e5cef 100644 --- a/include/libcamera/internal/media_object.h +++ b/include/libcamera/internal/media_object.h @@ -112,7 +112,7 @@ public: unsigned int deviceMinor() const { return minor_; } const std::vector &pads() const { return pads_; } - const std::vector ancillaryEntities() const { return ancillaryEntities_; } + const std::vector &ancillaryEntities() const { return ancillaryEntities_; } const MediaPad *getPadByIndex(unsigned int index) const; const MediaPad *getPadById(unsigned int id) const;