Short circuit zero time in Row_printTime()

Bail out early if the passed time is 0 and shadow the result.
wilder
Christian Göttsche 2 years ago committed by cgzones
parent 4e340c1817
commit ec608672ce
  1. 8
      Row.c

@ -337,6 +337,14 @@ void Row_printTime(RichString* str, unsigned long long totalHundredths, bool col
char buffer[10];
int len;
if (totalHundredths == 0) {
int shadowColor = coloring ? CRT_colors[PROCESS_SHADOW] : CRT_colors[PROCESS];
len = xSnprintf(buffer, sizeof(buffer), " 0:00.00 ");
RichString_appendnAscii(str, shadowColor, buffer, len);
return;
}
int yearColor = coloring ? CRT_colors[LARGE_NUMBER] : CRT_colors[PROCESS];
int dayColor = coloring ? CRT_colors[PROCESS_GIGABYTES] : CRT_colors[PROCESS];
int hourColor = coloring ? CRT_colors[PROCESS_MEGABYTES] : CRT_colors[PROCESS];

Loading…
Cancel
Save