src: simplify Reindent function in json_utils.cc
This PR replaces
std::string indent; for (int i = 0; i < indent_depth; i++) indent += ' ';
to const std::string indent(indent_depth, ' ');
and
do{...}while(true);
to for(;;){...}
.
This PR adds a fast return when indent <= 0
which means no change.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines