MCPcopy Create free account
hub / github.com/Effect-TS/effect / restore

Method restore

packages/effect/src/encoding/Xml.ts:1937–1947  ·  view source on GitHub ↗
(undo: number)

Source from the content-addressed store, hash-verified

1935
1936 // Undoes the binding changes made since `undo` was the length of the log
1937 private restore(undo: number): void {
1938 while (this.undoPrefixes.length > undo) {
1939 const prefix = this.undoPrefixes.pop()!
1940 // The binding in scope is the one this element made, which ends with it
1941 const size = prefix.length + (this.bindings.get(prefix)?.uri.length ?? 0)
1942 this.openDeclarationSize -= size
1943 this.releasedDeclarationSize += size
1944 this.bindings.set(prefix, this.undoBindings.pop())
1945 }
1946 if (this.releasedDeclarationSize > this.openDeclarationSize + compactDeclarationSize) this.compact()
1947 }
1948
1949 // Rebuilds the maps from the bindings in use. Their entries come from
1950 // declarations that are open or were released since the last rebuild, and

Callers 8

endElementMethod · 0.95
entityRuntime.tsFile · 0.45
Logic.test.tsFile · 0.45
paintShapeFunction · 0.45
makeFunction · 0.45
VirtualGrid.tsFile · 0.45
restoreAdjustmentFunction · 0.45
restoreControlledFunction · 0.45

Calls 3

compactMethod · 0.95
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected