File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -312,15 +312,20 @@ bool IsZero(double n) {
312312
313313ConsoleReporter::OutputOptions GetOutputOptions (bool force_no_color) {
314314 int output_opts = ConsoleReporter::OO_Defaults;
315- if ((FLAGS_benchmark_color == " auto" && IsColorTerminal ()) ||
316- IsTruthyFlagValue (FLAGS_benchmark_color)) {
315+ auto is_benchmark_color = [force_no_color] () -> bool {
316+ if (force_no_color) {
317+ return false ;
318+ }
319+ if (FLAGS_benchmark_color == " auto" ) {
320+ return IsColorTerminal ();
321+ }
322+ return IsTruthyFlagValue (FLAGS_benchmark_color);
323+ };
324+ if (is_benchmark_color ()) {
317325 output_opts |= ConsoleReporter::OO_Color;
318326 } else {
319327 output_opts &= ~ConsoleReporter::OO_Color;
320328 }
321- if (force_no_color) {
322- output_opts &= ~ConsoleReporter::OO_Color;
323- }
324329 if (FLAGS_benchmark_counters_tabular) {
325330 output_opts |= ConsoleReporter::OO_Tabular;
326331 } else {
You can’t perform that action at this time.
0 commit comments