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-30 21:02:11 +02:00
parent b6d6d4996a
commit 57bdb2f67f
+2 -2
View File
@@ -299,14 +299,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);