udpated the compiler and tester to use getOrDefault

This commit is contained in:
Araq 2015-10-13 14:10:33 +02:00
commit 8be9e46403
19 changed files with 82 additions and 59 deletions

View file

@ -387,7 +387,7 @@ var
proc getCookie*(name: string): TaintedString =
## Gets a cookie. If no cookie of `name` exists, "" is returned.
if gcookies == nil: gcookies = parseCookies(getHttpCookie())
result = TaintedString(gcookies[name])
result = TaintedString(gcookies.getOrDefault(name))
proc existsCookie*(name: string): bool =
## Checks if a cookie of `name` exists.