Optimize usage of cookie preferences

This commit is contained in:
Zed
2020-06-09 16:45:21 +02:00
parent 310c5e936d
commit db45433ec4
13 changed files with 88 additions and 52 deletions

View File

@@ -12,4 +12,10 @@ proc updateDefaultPrefs*(cfg: parsecfg.Config) =
proc getPrefs*(cookies: Table[string, string]): Prefs =
result = defaultPrefs
genCookiePrefs()
genCookiePrefs(cookies)
template getPref*(cookies: Table[string, string], pref): untyped =
bind genCookiePref
var res = defaultPrefs.`pref`
genCookiePref(cookies, pref, res)
res