Fix clang-tidy warning after upgrading to clang-tidy-15
This commit is contained in:
@@ -27,7 +27,6 @@ template <typename T> class nested_element_stack {
|
||||
public:
|
||||
nested_element_stack(bool is_flat)
|
||||
: is_flat_{is_flat}
|
||||
, current_level_{0}
|
||||
{
|
||||
current_level_groups_.push_back({});
|
||||
}
|
||||
@@ -66,7 +65,7 @@ public:
|
||||
private:
|
||||
bool is_flat_;
|
||||
|
||||
uint32_t current_level_;
|
||||
uint32_t current_level_{0};
|
||||
|
||||
std::vector<std::map<std::string, std::vector<T *>>> current_level_groups_;
|
||||
};
|
||||
|
||||
@@ -212,8 +212,9 @@ inja::json generator<C, D>::element_context(const E &e) const
|
||||
ctx["element"]["source"]["line"] = e.line();
|
||||
}
|
||||
|
||||
if (e.comment().has_value()) {
|
||||
ctx["element"]["comment"] = e.comment().value();
|
||||
const auto maybe_comment = e.comment();
|
||||
if (maybe_comment) {
|
||||
ctx["element"]["comment"] = maybe_comment.value();
|
||||
}
|
||||
|
||||
return ctx;
|
||||
|
||||
Reference in New Issue
Block a user