Fix CI: useless cast in the array index check of the view's JSON pointers

GCC -Werror=useless-cast on Linux x86-64 rejected
static_cast<std::uint64_t>((std::numeric_limits<std::size_t>::max)()),
as both are the same type there. Compare without the cast: std::size_t
converts to std::uint64_t implicitly on every platform.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-29 23:05:48 +02:00
parent bba3fa0307
commit dbbe96c42c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ index_status array_index(const StringType& s, std::size_t& idx) noexcept
}
v = (v * 10) + d;
}
if (v >= static_cast<std::uint64_t>((std::numeric_limits<std::size_t>::max)()))
if (v >= (std::numeric_limits<std::size_t>::max)()) // (std::size_t converts to std::uint64_t implicitly)
{
return index_status::too_large;
}
+1 -1
View File
@@ -2464,7 +2464,7 @@ index_status array_index(const StringType& s, std::size_t& idx) noexcept
}
v = (v * 10) + d;
}
if (v >= static_cast<std::uint64_t>((std::numeric_limits<std::size_t>::max)()))
if (v >= (std::numeric_limits<std::size_t>::max)()) // (std::size_t converts to std::uint64_t implicitly)
{
return index_status::too_large;
}