Initialize various maps

This commit is contained in:
Kovid Goyal
2022-08-24 20:47:00 +05:30
parent cd54fefa99
commit 818f68ec53
3 changed files with 13 additions and 2 deletions

View File

@@ -151,6 +151,9 @@ type ParsedShortcut struct {
var parsed_shortcut_cache map[string]ParsedShortcut
func ParseShortcut(spec string) *ParsedShortcut {
if parsed_shortcut_cache == nil {
parsed_shortcut_cache = make(map[string]ParsedShortcut, 128)
}
if val, ok := parsed_shortcut_cache[spec]; ok {
return &val
}