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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user