libcamera: yaml_parser: Use std::make_unique<>

The YamlParser::parse() function constructs a std::unique_ptr<> instance
with a manual call to operator new. Replace it with std::make_unique<>.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2025-10-15 17:14:47 +03:00
parent 178007f8ad
commit 01f5db9559

View File

@@ -769,7 +769,7 @@ std::unique_ptr<YamlObject> YamlParser::parse(File &file)
if (context.init(file))
return nullptr;
std::unique_ptr<YamlObject> root(new YamlObject());
std::unique_ptr<YamlObject> root = std::make_unique<YamlObject>();
if (context.parseContent(*root)) {
LOG(YamlParser, Error)