From a7aab7da8a716299661b5f451366fb6e2f3d88b2 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 16 Dec 2024 00:28:33 +0200 Subject: libcamera: yaml_parser: Improve efficiency of string empty check Comparing a std::string to an empty string literal is more complex than using the std::string::empty() function. Improve the code efficiency by replacing the former with the latter. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Kieran Bingham --- src/libcamera/yaml_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp index 5ca5fb82..a5e42461 100644 --- a/src/libcamera/yaml_parser.cpp +++ b/src/libcamera/yaml_parser.cpp @@ -194,7 +194,7 @@ YamlObject::Getter::get(const YamlObject &obj) const if (obj.type_ != Type::Value) return std::nullopt; - if (obj.value_ == "") + if (obj.value_.empty()) return std::nullopt; char *end; -- cgit v1.2.1