Optimization for the times module; changed let to const.

This commit is contained in:
dom96 2012-02-17 10:54:45 +00:00
commit 7fde07ab29

View file

@ -379,15 +379,15 @@ proc getClockStr*(): string {.rtl, extern: "nt$1".} =
proc `$`*(day: TWeekDay): string = proc `$`*(day: TWeekDay): string =
## stingify operator for ``TWeekDay``. ## stingify operator for ``TWeekDay``.
let lookup: array[TWeekDay, string] = ["Monday", "Tuesday", "Wednesday", "Thursday", const lookup: array[TWeekDay, string] = ["Monday", "Tuesday", "Wednesday",
"Friday", "Saturday", "Sunday"] "Thursday", "Friday", "Saturday", "Sunday"]
return lookup[day] return lookup[day]
proc `$`*(m: TMonth): string = proc `$`*(m: TMonth): string =
## stingify operator for ``TMonth``. ## stingify operator for ``TMonth``.
let lookup: array[TMonth, string] = ["January", "February", "March", "April", const lookup: array[TMonth, string] = ["January", "February", "March",
"May", "June", "July", "August", "September", "October", "November", "April", "May", "June", "July", "August", "September", "October",
"December"] "November", "December"]
return lookup[m] return lookup[m]
{.pop.} {.pop.}