From patchwork Thu Jun 16 14:24:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 16240 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 47906BD808 for ; Thu, 16 Jun 2022 14:24:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D2D1065641; Thu, 16 Jun 2022 16:24:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1655389464; bh=Ic3F3Afbq5cwq4A8ifAQhqKg4w3eXeU4Dm+xJoUklrM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=D9wZzsfYXFKeAspcyFkpcgiBEobEXVG6AaDF8TkXXSeluC+gj1w7gwkYXahs6QQjU C1Q8kWsdkR5rb7HwAMHFQNKeDrSzQd6mBSUJmGQGt4N8UdE9XfhDBZOj3sXGpnc558 MU94zNs/2sENAqgJmFyN94Ixz0HA7cvMcwDSZzOB9BTMDW2H2TBh+uy43jDLHhX3+D fozhEVPhGduiErpYqVVNp/Fw0l1vCwJhg3Cs4bqPjPjq+8WZZhfug/XjZXoh4NCGg0 v6c71aabR56b5iCKzzoEaukhkB3uSrGKiwEJ0YNmNOxJ8CfLPNu4tu99MPlMMTv2sR W8CpS4cn3jgAA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DE99865635 for ; Thu, 16 Jun 2022 16:24:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DVUuGjnV"; dkim-atps=neutral Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 444F1898; Thu, 16 Jun 2022 16:24:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1655389460; bh=Ic3F3Afbq5cwq4A8ifAQhqKg4w3eXeU4Dm+xJoUklrM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DVUuGjnVffbpor9ACXyCXzhaOKSMWRvIRRaaVs66tUPUX+e4oWLcesfltn9VoRsly qTDJl+8K966EM+IV664CbN+obPK9MhA7nazHVxO3EAEtzOpL+qV3kETPjFXKwmesci 69j1+OoeVu6flVE9zIfvpG2UcOvjz8V8s2FHuXz8= To: libcamera-devel@lists.libcamera.org Date: Thu, 16 Jun 2022 17:24:00 +0300 Message-Id: <20220616142403.20723-5-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220616142403.20723-1-laurent.pinchart@ideasonboard.com> References: <20220616142403.20723-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/7] android: Use the YamlObject iterator API 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: , X-Patchwork-Original-From: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Replace usage of YamlObject::memberNames() with the more efficient iterator API. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Han-Lin Chen --- src/android/camera_hal_config.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp index ac484b8df1bd..bacfe4b9c505 100644 --- a/src/android/camera_hal_config.cpp +++ b/src/android/camera_hal_config.cpp @@ -82,10 +82,8 @@ int CameraHalConfig::Private::parseConfigFile(File &file, if (!yamlObjectCameras.isDictionary()) return -EINVAL; - std::vector cameraIds = yamlObjectCameras.memberNames(); - for (const std::string &cameraId : cameraIds) { - if (parseCameraConfigData(cameraId, - yamlObjectCameras[cameraId])) + for (const auto &[cameraId, configData] : yamlObjectCameras.asDict()) { + if (parseCameraConfigData(cameraId, configData)) return -EINVAL; }