times.nim: minor code cleanup

This commit is contained in:
Araq 2018-08-30 23:55:54 +02:00
commit fab4498727

View file

@ -608,7 +608,6 @@ proc stringifyUnit(value: int | int64, unit: TimeUnit): string =
proc humanizeParts(parts: seq[string]): string = proc humanizeParts(parts: seq[string]): string =
## Make date string parts human-readable ## Make date string parts human-readable
result = "" result = ""
if parts.len == 0: if parts.len == 0:
result.add "0 nanoseconds" result.add "0 nanoseconds"
@ -617,8 +616,8 @@ proc humanizeParts(parts: seq[string]): string =
elif parts.len == 2: elif parts.len == 2:
result = parts[0] & " and " & parts[1] result = parts[0] & " and " & parts[1]
else: else:
for part in parts[0..high(parts)-1]: for i in 0..high(parts)-1:
result.add part & ", " result.add parts[i] & ", "
result.add "and " & parts[high(parts)] result.add "and " & parts[high(parts)]
proc `$`*(dur: Duration): string = proc `$`*(dur: Duration): string =