From fa0814e257f692fcfd5b53dcadd5b283bf9fa2b7 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 15 Apr 2025 21:57:13 +0100 Subject: [PATCH] Codefix: Codestyle consistency fixes. (#14008) --- src/core/string_builder.hpp | 5 ++--- src/core/string_consumer.hpp | 8 ++++---- src/core/string_inplace.hpp | 6 ++---- src/string.cpp | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/core/string_builder.hpp b/src/core/string_builder.hpp index 77fba335fd..c6058bab05 100644 --- a/src/core/string_builder.hpp +++ b/src/core/string_builder.hpp @@ -53,7 +53,7 @@ public: /** * Append integer 'value' in given number 'base'. */ - template + template void PutIntegerBase(T value, int base) { std::array buf; @@ -67,8 +67,7 @@ public: /** * Compose data into a growing std::string. */ -class StringBuilder final : public BaseStringBuilder -{ +class StringBuilder final : public BaseStringBuilder { std::string *dest; public: /** diff --git a/src/core/string_consumer.hpp b/src/core/string_consumer.hpp index b85bf65eb9..e4e9145fa3 100644 --- a/src/core/string_consumer.hpp +++ b/src/core/string_consumer.hpp @@ -800,7 +800,7 @@ public: void SkipUntilUtf8(char32_t c, SeparatorUsage sep); private: - template + template [[nodiscard]] static std::pair ParseIntegerBase(std::string_view src, int base, bool log_errors) { if (base == 0) { @@ -850,7 +850,7 @@ public: * @return Length of string match, and parsed value. * @note The parser rejects leading whitespace and unary plus. */ - template + template [[nodiscard]] std::pair PeekIntegerBase(int base) const { return ParseIntegerBase(this->src.substr(this->position), base, false); @@ -861,7 +861,7 @@ public: * @return Parsed value, if valid. * @note The parser rejects leading whitespace and unary plus. */ - template + template [[nodiscard]] std::optional TryReadIntegerBase(int base) { auto [len, value] = this->PeekIntegerBase(base); @@ -876,7 +876,7 @@ public: * @note The reader is advanced, even if no valid data was present. * @note The parser rejects leading whitespace and unary plus. */ - template + template [[nodiscard]] T ReadIntegerBase(int base, T def = 0) { auto [len, value] = ParseIntegerBase(this->src.substr(this->position), base, true); diff --git a/src/core/string_inplace.hpp b/src/core/string_inplace.hpp index 855ae55896..eaf16752b0 100644 --- a/src/core/string_inplace.hpp +++ b/src/core/string_inplace.hpp @@ -18,8 +18,7 @@ /** * Builder implementation for InPlaceReplacement. */ -class InPlaceBuilder final : public BaseStringBuilder -{ +class InPlaceBuilder final : public BaseStringBuilder { std::span dest; size_type position = 0; const StringConsumer &consumer; @@ -90,8 +89,7 @@ public: * - The Builder writes data to the buffer, replacing already consumed data. * - The Builder asserts, if it overtakes the consumer. */ -class InPlaceReplacement -{ +class InPlaceReplacement { public: StringConsumer consumer; ///< Consumer from shared buffer InPlaceBuilder builder; ///< Builder into shared buffer diff --git a/src/string.cpp b/src/string.cpp index a9d72efab9..21cd8f0ced 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -117,7 +117,7 @@ static bool IsSccEncodedCode(char32_t c) * @param consumer The string to validate. * @param settings The settings for the string validation. */ -template +template static void StrMakeValid(Builder &builder, StringConsumer &consumer, StringValidationSettings settings) { /* Assume the ABSOLUTE WORST to be in str as it comes from the outside. */