clang-format
This commit is contained in:
parent
41192d922e
commit
58519548e6
@ -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);
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user