replaceAll atomically swaps the map contents for the given values, keyed via cfg.Key.
(vals []V)
| 262 | // replaceAll atomically swaps the map contents for the given values, keyed via |
| 263 | // cfg.Key. |
| 264 | func (m *SyncedMap[K, V]) replaceAll(vals []V) { |
| 265 | next := make(map[K]V, len(vals)) |
| 266 | for _, v := range vals { |
| 267 | next[m.cfg.Key(v)] = v |
| 268 | } |
| 269 | m.mu.Lock() |
| 270 | m.data = next |
| 271 | m.mu.Unlock() |
| 272 | } |
| 273 | |
| 274 | // reconcileLoop periodically re-hydrates to repair silent drift (missed deltas). |
| 275 | func (m *SyncedMap[K, V]) reconcileLoop() { |
no test coverage detected