diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-12-16 00:28:33 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-12-16 14:26:45 +0200 |
commit | a7aab7da8a716299661b5f451366fb6e2f3d88b2 (patch) | |
tree | 1b8891bbfe8e9a1a69a0b99a1f729c73e708fa08 | |
parent | 8e15010b7dfa9c2a68dd57f924b5603784be0e09 (diff) |
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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r-- | src/libcamera/yaml_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<double>::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; |