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:
parent
8e15010b7d
commit
a7aab7da8a
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue