diff options
| author | Fuwn <[email protected]> | 2022-06-24 04:38:44 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-06-24 04:38:44 -0700 |
| commit | 6841c656a0c5ead810f50405d4b3ac701380e51b (patch) | |
| tree | 249fa166cc6c04c44cbbe1bb9f338ebe79dc86ce /src/context.cc | |
| parent | ci: push source to remote (diff) | |
| download | cait-6841c656a0c5ead810f50405d4b3ac701380e51b.tar.xz cait-6841c656a0c5ead810f50405d4b3ac701380e51b.zip | |
fix(src): apply clang-tidy fixes
Diffstat (limited to 'src/context.cc')
| -rw-r--r-- | src/context.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/context.cc b/src/context.cc index 1c1dce2..f34d55c 100644 --- a/src/context.cc +++ b/src/context.cc @@ -16,8 +16,6 @@ // Copyright (C) 2022-2022 Fuwn <[email protected]> // SPDX-License-Identifier: GPL-3.0-only -#include <iostream> -#include <optional> #include <thread> #include "context.hh" @@ -27,7 +25,7 @@ namespace cait { context::context(const parser &parser) { this->jobs = std::thread::hardware_concurrency() + 2; - for (auto &parse_node : parser.nodes()) { + for (const auto &parse_node : parser.nodes()) { std::visit( [this](auto &node) { using T = std::decay_t<decltype(node)>; @@ -54,9 +52,9 @@ context::context(const parser &parser) { if (it == nullptr) { return std::nullopt; - } else { - return *it; } + + return *it; } [[maybe_unused]] auto context::rule(const std::string &variable) @@ -66,9 +64,9 @@ context::context(const parser &parser) { if (it == nullptr) { return std::nullopt; - } else { - return *it; } + + return *it; } [[maybe_unused]] auto context::build(const std::string &variable) @@ -78,9 +76,9 @@ context::context(const parser &parser) { if (it == nullptr) { return std::nullopt; - } else { - return *it; } + + return *it; } } // namespace cait |