MCPcopy
hub / github.com/mudler/LocalAI / replaceAll

Method replaceAll

core/services/syncstate/syncstate.go:264–272  ·  view source on GitHub ↗

replaceAll atomically swaps the map contents for the given values, keyed via cfg.Key.

(vals []V)

Source from the content-addressed store, hash-verified

262// replaceAll atomically swaps the map contents for the given values, keyed via
263// cfg.Key.
264func (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).
275func (m *SyncedMap[K, V]) reconcileLoop() {

Callers 15

hydrateMethod · 0.95
pdf.min.jsFile · 0.80
rfc2616unquoteFunction · 0.80
rfc2047decodeFunction · 0.80
renderMethod · 0.80
pdf.worker.min.jsFile · 0.80
_collectJSFunction · 0.80
loadXfaFontsMethod · 0.80
_simpleFontToUnicodeMethod · 0.80
translateFontMethod · 0.80
createPostscriptNameFunction · 0.80
constructorMethod · 0.80

Calls 3

KeyMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected