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) {
312
312
313
313
ConsoleReporter::OutputOptions GetOutputOptions (bool force_no_color) {
314
314
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 ()) {
317
325
output_opts |= ConsoleReporter::OO_Color;
318
326
} else {
319
327
output_opts &= ~ConsoleReporter::OO_Color;
320
328
}
321
- if (force_no_color) {
322
- output_opts &= ~ConsoleReporter::OO_Color;
323
- }
324
329
if (FLAGS_benchmark_counters_tabular) {
325
330
output_opts |= ConsoleReporter::OO_Tabular;
326
331
} else {
You can’t perform that action at this time.
0 commit comments