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 7174fe4ab8
commit cf4bd21c81
2 changed files with 2 additions and 2 deletions

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;
}

View File

@@ -2462,7 +2462,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;
}