libcamera: yaml_parser: Replace getList() with get() specializations
The YamlObject class has two member function templates to get values: the get() function gets a scalar value, while the getList() function gets a vector of scalar values. As get() is a function template, we can provide specializations for vector types. This makes the code more systematic, and therefore more readable. Replace all getList() occurrences, and drop the getList() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
This commit is contained in:
@@ -587,9 +587,9 @@ protected:
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
const auto &values = firstElement.getList<uint16_t>();
|
||||
const auto &values = firstElement.get<std::vector<uint16_t>>();
|
||||
if (!values || values->size() != 2 || (*values)[0] != 1 || (*values)[1] != 2) {
|
||||
cerr << "getList() failed to return correct vector" << std::endl;
|
||||
cerr << "get() failed to return correct vector" << std::endl;
|
||||
return TestFail;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user