mirror of
https://github.com/nlohmann/json.git
synced 2026-10-22 22:08:55 +00:00
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:
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);
|
||||
}
|
||||
|
||||
Generated
+2
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user