From patchwork Fri Aug 15 11:33:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 24134 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 F3D1ABEFBE for ; Fri, 15 Aug 2025 11:34:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7363D6925D; Fri, 15 Aug 2025 13:34:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="LA7ihypI"; 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 A370269257 for ; Fri, 15 Aug 2025 13:34:26 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 9A71B63B; Fri, 15 Aug 2025 13:33:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755257611; bh=R+akpr3BA09U9c5eXYOfZHxCa4barmtuykPCYQuuVC8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LA7ihypIGQgFNWvMAnKNcHI2ILeUi4H1y6sSL7Boig6ZrDCayPqVToibtYsGwR0Pn Ms7ItwOVEivGFUlWaksVDszneEP4fRBcBzAA+RusKRhVPdHZHFduH09+p8W88sAVVC QFMQOysHY1vTfvbAYBjyQuVTmxyl9ZMhsHewuRlw= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?q?Daniel_R=C3=A1kos?= Subject: [PATCH v2 4/8] pipeline: rpi: Use structured bindings in range-based for loop Date: Fri, 15 Aug 2025 14:33:56 +0300 Message-ID: <20250815113400.20623-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.49.1 In-Reply-To: <20250815113400.20623-1-laurent.pinchart@ideasonboard.com> References: <20250815113400.20623-1-laurent.pinchart@ideasonboard.com> 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" Simplify a range-based for loop by replacing an iterator with structure bindings. This makes the code easier to read. Signed-off-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 563df198e6e4..09d30f34d9b7 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -882,10 +882,10 @@ void PipelineHandlerBase::mapBuffers(Camera *camera, const BufferMap &buffers, u * This will allow us to identify buffers passed between the pipeline * handler and the IPA. */ - for (auto const &it : buffers) { - bufferIds.push_back(IPABuffer(mask | it.first, - it.second.buffer->planes())); - data->bufferIds_.insert(mask | it.first); + for (auto const &[id, buffer] : buffers) { + bufferIds.push_back(IPABuffer(mask | id, + buffer.buffer->planes())); + data->bufferIds_.insert(mask | id); } data->ipa_->mapBuffers(bufferIds);