Compare the token carry buffer's free space as a size_t variable

clang-tidy's modernize-use-integer-sign-comparison (C++20) took the cast
pointer difference for a signed operand.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-22 17:48:22 +02:00
1 parent 9666b0e888
commit f83a689909
2 files changed
+4 -2

No files matched your search

@@ -109,7 +109,8 @@ class token_carry_buffer
void append(const char* first, const char* last)
{
const auto n = static_cast<std::size_t>(last - first);
if (n > static_cast<std::size_t>(m_capacity_end - m_end))
const auto room = static_cast<std::size_t>(m_capacity_end - m_end);
if (n > room)
{
grow(n);
}
+2 -1
View File
@@ -8574,7 +8574,8 @@ class token_carry_buffer
void append(const char* first, const char* last)
{
const auto n = static_cast<std::size_t>(last - first);
if (n > static_cast<std::size_t>(m_capacity_end - m_end))
const auto room = static_cast<std::size_t>(m_capacity_end - m_end);
if (n > room)
{
grow(n);
}