From d222ad2d9869ff2abc1f27b2109e6cf65e09e77f Mon Sep 17 00:00:00 2001 From: pantor Date: Sat, 18 Oct 2025 06:54:13 -0700 Subject: [PATCH] fix more clang-tidy warnings --- .clang-tidy | 1 + include/inja/renderer.hpp | 2 +- single_include/inja/inja.hpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 38c2b2f..0a1178d 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,6 +3,7 @@ Checks: > -abseil-*, -altera-*, -boost-*, + -cppcoreguidelines-avoid-const-or-ref-data-members, -cppcoreguidelines-avoid-goto, -cppcoreguidelines-non-private-member-variables-in-classes, -fuchsia-*, diff --git a/include/inja/renderer.hpp b/include/inja/renderer.hpp index 32070a6..a546664 100644 --- a/include/inja/renderer.hpp +++ b/include/inja/renderer.hpp @@ -30,7 +30,7 @@ namespace inja { */ inline std::string htmlescape(const std::string& data) { std::string buffer; - buffer.reserve((unsigned int)(1.1 * data.size())); + buffer.reserve(static_cast(1.1 * data.size())); for (size_t pos = 0; pos != data.size(); ++pos) { switch (data[pos]) { case '&': buffer.append("&"); break; diff --git a/single_include/inja/inja.hpp b/single_include/inja/inja.hpp index 14d2d29..1e85cf2 100644 --- a/single_include/inja/inja.hpp +++ b/single_include/inja/inja.hpp @@ -1967,7 +1967,7 @@ class Parser { throw_parser_error("expected id, got '" + tok.describe() + "'"); } - const Token key_token = std::move(value_token); + const Token key_token = value_token; value_token = tok; get_next_token(); @@ -2183,7 +2183,7 @@ namespace inja { */ inline std::string htmlescape(const std::string& data) { std::string buffer; - buffer.reserve((unsigned int)(1.1 * data.size())); + buffer.reserve(static_cast(1.1 * data.size())); for (size_t pos = 0; pos != data.size(); ++pos) { switch (data[pos]) { case '&': buffer.append("&"); break;