Address the clang-tidy findings of the structural edit tests

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-29 01:04:06 +02:00
parent 1e212bc50c
commit 3c5c000408

View File

@@ -297,14 +297,14 @@ TEST_CASE("json_view edits: differential")
}
else if (op == 8 && target.is_array()) // insert
{
const std::size_t i = static_cast<std::size_t>(r(static_cast<int>(target.size()) + 1));
const auto i = static_cast<std::size_t>(r(static_cast<int>(target.size()) + 1));
const ordered_json v = random_value(2);
d.insert(tv, i, v);
j[p].insert(j[p].begin() + static_cast<std::ptrdiff_t>(i), v);
}
else if (op == 9 && target.is_array() && !target.empty()) // erase an element
{
const std::size_t i = static_cast<std::size_t>(r(static_cast<int>(target.size())));
const auto i = static_cast<std::size_t>(r(static_cast<int>(target.size())));
if (r(2) == 0)
{
d.erase(tv, i);