clang-format

This commit is contained in:
Billy Donahue 2021-02-04 08:33:20 -05:00
parent 41192d922e
commit 58519548e6
2 changed files with 8 additions and 8 deletions

View File

@ -913,7 +913,7 @@ void Value::resize(ArrayIndex newSize) {
clear(); clear();
else if (newSize > oldSize) else if (newSize > oldSize)
for (ArrayIndex i = oldSize; i < newSize; ++i) for (ArrayIndex i = oldSize; i < newSize; ++i)
(*this)[i]; (*this)[i];
else { else {
for (ArrayIndex index = newSize; index < oldSize; ++index) { for (ArrayIndex index = newSize; index < oldSize; ++index) {
value_.map_->erase(index); value_.map_->erase(index);

View File

@ -351,13 +351,13 @@ JSONTEST_FIXTURE_LOCAL(ValueTest, resizeArray) {
} }
JSONTEST_FIXTURE_LOCAL(ValueTest, resizePopulatesAllMissingElements) { JSONTEST_FIXTURE_LOCAL(ValueTest, resizePopulatesAllMissingElements) {
int n = 10; int n = 10;
Json::Value v; Json::Value v;
v.resize(n); v.resize(n);
JSONTEST_ASSERT_EQUAL(n, v.size()); JSONTEST_ASSERT_EQUAL(n, v.size());
JSONTEST_ASSERT_EQUAL(n, std::distance(v.begin(), v.end())); JSONTEST_ASSERT_EQUAL(n, std::distance(v.begin(), v.end()));
for (const Json::Value& e : v) for (const Json::Value& e : v)
JSONTEST_ASSERT_EQUAL(e, Json::Value{}); JSONTEST_ASSERT_EQUAL(e, Json::Value{});
} }
JSONTEST_FIXTURE_LOCAL(ValueTest, getArrayValue) { JSONTEST_FIXTURE_LOCAL(ValueTest, getArrayValue) {