mirror of
https://github.com/nlohmann/json.git
synced 2026-10-11 08:57:15 +00:00
Fix the clang-tidy 22 findings in json_view and its tests
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
3 files changed
+20
-20
No files matched your search
@@ -127,7 +127,7 @@ template<typename SizeType, typename IntegerType>
|
||||
SizeType to_index(IntegerType idx) noexcept
|
||||
{
|
||||
const IntegerType zero = 0;
|
||||
const auto result = static_cast<SizeType>(idx);
|
||||
const auto result = static_cast<SizeType>(idx); // NOLINT(bugprone-signed-char-misuse,cert-str34-c): negative values are mapped below
|
||||
return (idx < zero || static_cast<IntegerType>(result) != idx) ? (std::numeric_limits<SizeType>::max)() : result;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user