From patchwork Thu Aug 14 15:14:20 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: 24105 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 3AAC7BEFBE for ; Thu, 14 Aug 2025 15:14:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 59A7169247; Thu, 14 Aug 2025 17:14:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="MFJGeLEw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 558E861444 for ; Thu, 14 Aug 2025 17:14:24 +0200 (CEST) Received: from pb-laptop.local (185.221.141.188.nat.pool.zt.hu [185.221.141.188]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F3CCC6DF for ; Thu, 14 Aug 2025 17:13:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1755184410; bh=TRNkzEc8aaRhVs1loGsMIVZXgXUJucrVC2vi9qurPnE=; h=From:To:Subject:Date:From; b=MFJGeLEwjFw4qgcHvTc3Vn4jnfdlx0EnDSJXO4hNx603twKNELS8OERIcye5os8Hh Ib+N54fG2eQn0y3FlaovBwqisvzPI3C2S6StKv1CUhrKZovhMXjrRJkhqBWeKPFfGh mG9CM+psUQx/034vNor10jkN/NJReEZk+6bfzcn0= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1] apps: common: options: Avoid copying in range based for loop Date: Thu, 14 Aug 2025 17:14:20 +0200 Message-ID: <20250814151420.2119927-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.50.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" The copy can trigger `-Wrange-loop-construct`, so use a reference to avoid the warning. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/apps/common/options.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/common/options.cpp b/src/apps/common/options.cpp index cae193cc4..b4ea1afe2 100644 --- a/src/apps/common/options.cpp +++ b/src/apps/common/options.cpp @@ -887,7 +887,7 @@ OptionsParser::Options OptionsParser::parse(int argc, char **argv) shortOptions[ids++] = ':'; - for (const auto [opt, option] : optionsMap_) { + for (const auto &[opt, option] : optionsMap_) { if (option->hasShortOption()) { shortOptions[ids++] = opt; if (option->argument != ArgumentNone)