Remove conditional check for isMultiLine

At all 3 places isMultiLine is checked in for loop :
for (int index = 0; index < size && !isMultiLine; ++index) {
It means !isMultiLine is always true (otherwise do not enter loop), so || condition does not depend on isMultiLine, so removed that.
This commit is contained in:
Gaurav 2015-09-22 09:48:54 +05:30
parent cc5cdb565c
commit 6ee0bff822

View File

@ -489,8 +489,7 @@ bool StyledWriter::isMultineArray(const Value& value) {
childValues_.clear(); childValues_.clear();
for (int index = 0; index < size && !isMultiLine; ++index) { for (int index = 0; index < size && !isMultiLine; ++index) {
const Value& childValue = value[index]; const Value& childValue = value[index];
isMultiLine = isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
isMultiLine || ((childValue.isArray() || childValue.isObject()) &&
childValue.size() > 0); childValue.size() > 0);
} }
if (!isMultiLine) // check if line length > max line length if (!isMultiLine) // check if line length > max line length
@ -709,8 +708,7 @@ bool StyledStreamWriter::isMultineArray(const Value& value) {
childValues_.clear(); childValues_.clear();
for (int index = 0; index < size && !isMultiLine; ++index) { for (int index = 0; index < size && !isMultiLine; ++index) {
const Value& childValue = value[index]; const Value& childValue = value[index];
isMultiLine = isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
isMultiLine || ((childValue.isArray() || childValue.isObject()) &&
childValue.size() > 0); childValue.size() > 0);
} }
if (!isMultiLine) // check if line length > max line length if (!isMultiLine) // check if line length > max line length
@ -989,8 +987,7 @@ bool BuiltStyledStreamWriter::isMultineArray(Value const& value) {
childValues_.clear(); childValues_.clear();
for (int index = 0; index < size && !isMultiLine; ++index) { for (int index = 0; index < size && !isMultiLine; ++index) {
Value const& childValue = value[index]; Value const& childValue = value[index];
isMultiLine = isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
isMultiLine || ((childValue.isArray() || childValue.isObject()) &&
childValue.size() > 0); childValue.size() > 0);
} }
if (!isMultiLine) // check if line length > max line length if (!isMultiLine) // check if line length > max line length