diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-05-25 01:58:11 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-06-20 15:12:12 +0300 |
commit | 12bf40414776e4acb1b1b2d2a1c429a564a7d504 (patch) | |
tree | b4958798de9309e0c952c0f5b7ac39700f59a598 | |
parent | 90577226aabbde593e61b234ffa4b2193c53ddef (diff) |
android: Use the YamlObject iterator API
Replace usage of YamlObject::memberNames() with the more efficient
iterator API.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
-rw-r--r-- | src/android/camera_hal_config.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp index ac484b8d..bacfe4b9 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<std::string> 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; } |