newKeywordSuggestionCache creates a new cache with the given max size
(maxSize int)
| 41 | |
| 42 | // newKeywordSuggestionCache creates a new cache with the given max size |
| 43 | func newKeywordSuggestionCache(maxSize int) *keywordSuggestionCache { |
| 44 | return &keywordSuggestionCache{ |
| 45 | cache: make(map[string]string), |
| 46 | maxSize: maxSize, |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | // get retrieves a cached suggestion if available |
| 51 | func (c *keywordSuggestionCache) get(input string) (string, bool) { |
no outgoing calls