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>
This commit is contained in:
Laurent Pinchart 2024-12-16 00:28:33 +02:00
parent 8e15010b7d
commit a7aab7da8a

View file

@ -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;