Skip to content

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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading