mirror of
https://github.com/XRPLF/clio.git
synced 2026-08-21 20:50:53 +00:00
chore: Enable more clang-tidy checks (#3054)
This commit is contained in:
@@ -47,13 +47,13 @@ ClioConfigDefinition::getObject(std::string_view prefix, std::optional<std::size
|
||||
for (auto const& [mapKey, mapVal] : map_) {
|
||||
auto const hasPrefix = mapKey.starts_with(prefixWithDot);
|
||||
if (idx.has_value() && hasPrefix && std::holds_alternative<Array>(mapVal)) {
|
||||
ASSERT(std::get<Array>(mapVal).size() > idx.value(), "Index provided is out of scope");
|
||||
ASSERT(std::get<Array>(mapVal).size() > *idx, "Index provided is out of scope");
|
||||
|
||||
// we want to support getObject("array") and getObject("array.[]"), so we check if "[]"
|
||||
// exists
|
||||
if (!prefix.contains("[]"))
|
||||
return ObjectView{prefixWithDot + "[]", idx.value(), *this};
|
||||
return ObjectView{prefix, idx.value(), *this};
|
||||
return ObjectView{prefixWithDot + "[]", *idx, *this};
|
||||
return ObjectView{prefix, *idx, *this};
|
||||
}
|
||||
if (hasPrefix && !idx.has_value() && !mapKey.contains(prefixWithDot + "[]"))
|
||||
return ObjectView{prefix, *this};
|
||||
@@ -174,7 +174,7 @@ ClioConfigDefinition::parse(ConfigFileInterface const& config)
|
||||
[&key, &config, &listOfErrors](ConfigValue& val) {
|
||||
if (auto const maybeError = val.setValue(config.getValue(key), key);
|
||||
maybeError.has_value()) {
|
||||
listOfErrors.emplace_back(maybeError.value());
|
||||
listOfErrors.emplace_back(*maybeError);
|
||||
}
|
||||
},
|
||||
// handle the case where the config value is an array.
|
||||
|
||||
Reference in New Issue
Block a user