sys: Fixed many clang tidy warnings and typos

This commit is contained in:
WerWolv
2022-03-04 20:52:39 +01:00
parent 57c449936f
commit 327e904dbc
64 changed files with 91 additions and 152 deletions

View File

@@ -298,11 +298,11 @@ namespace hex::pl {
}
}
arrayPattern->setEntries(std::move(entries));
if (auto &arrayEntries = arrayPattern->getEntries(); !entries.empty())
arrayPattern->setTypeName(arrayEntries.front()->getTypeName());
arrayPattern->setEntries(std::move(entries));
arrayPattern->setSize(size);
return std::move(arrayPattern);

View File

@@ -38,7 +38,7 @@ namespace hex::pl {
std::vector<std::pair<std::string, ASTNode *>> entries;
for (const auto &[name, entry] : this->m_entries)
entries.push_back({ name, entry.get() });
entries.emplace_back(name, entry.get());
if (order == BitfieldOrder::LeftToRight)
std::reverse(entries.begin(), entries.end());

View File

@@ -22,10 +22,6 @@ namespace hex::pl {
return std::unique_ptr<ASTNode>(new ASTNodeControlFlowStatement(*this));
}
[[nodiscard]] const std::unique_ptr<ASTNode> &getReturnValue() const {
return this->m_rvalue;
}
[[nodiscard]] std::vector<std::unique_ptr<Pattern>> createPatterns(Evaluator *evaluator) const override {
this->execute(evaluator);

View File

@@ -52,7 +52,6 @@ namespace hex::pl {
}
[[nodiscard]] const std::vector<std::shared_ptr<ASTNode>> &getMembers() const { return this->m_members; }
void addMember(std::shared_ptr<ASTNode> &&node) { this->m_members.push_back(std::move(node)); }
private:
std::vector<std::shared_ptr<ASTNode>> m_members;