diff --git a/cli/source/subcommands/docs.cpp b/cli/source/subcommands/docs.cpp index abffcc1c..12e32d6c 100644 --- a/cli/source/subcommands/docs.cpp +++ b/cli/source/subcommands/docs.cpp @@ -24,9 +24,7 @@ namespace pl::cli::sub { std::string getTypeEndian(const core::ast::ASTNodeTypeApplication *typeApp) { auto endian = typeApp->getEndian(); - if (!endian.has_value()) - return ""; - else if (endian == std::endian::little) + if (endian == std::endian::little) return "le "; else if (endian == std::endian::big) return "be "; @@ -144,7 +142,7 @@ namespace pl::cli::sub { auto ast = runtime.parseString(patternFile.readString(), wolv::util::toUTF8String(patternFile.getPath())); if (!ast.has_value()) { auto compileErrors = runtime.getCompileErrors(); - if (compileErrors.size()>0) { + if (!compileErrors.empty()) { fmt::print("Compilation failed\n"); for (const auto &error : compileErrors) { fmt::print("{}\n", error.format()); diff --git a/lib/source/pl/core/ast/ast_node_match_statement.cpp b/lib/source/pl/core/ast/ast_node_match_statement.cpp index 423289fe..d02dc610 100644 --- a/lib/source/pl/core/ast/ast_node_match_statement.cpp +++ b/lib/source/pl/core/ast/ast_node_match_statement.cpp @@ -9,7 +9,7 @@ namespace pl::core::ast { ASTNodeMatchStatement::ASTNodeMatchStatement(std::vector cases, std::optional defaultCase) - : ASTNode(), m_cases(std::move(cases)), m_defaultCase(std::move(defaultCase)) { } + : m_cases(std::move(cases)), m_defaultCase(std::move(defaultCase)) { } ASTNodeMatchStatement::ASTNodeMatchStatement(const ASTNodeMatchStatement &other) : ASTNode(other) { for (auto &matchCase : other.m_cases)