NewLruInterner returns a new Interner to be used to intern strings. The interner will use a LRU cache to return the deduplicated strings
(enabled bool)
| 147 | // NewLruInterner returns a new Interner to be used to intern strings. |
| 148 | // The interner will use a LRU cache to return the deduplicated strings |
| 149 | func NewLruInterner(enabled bool) Interner { |
| 150 | if !enabled { |
| 151 | return &noOpInterner{} |
| 152 | } |
| 153 | return &pool{ |
| 154 | lru: expirable.NewLRU[string, string](maxInternerLruCacheSize, nil, internerLruCacheTTL), |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | type noOpInterner struct{} |
| 159 |