MCPcopy
hub / github.com/microsoft/vscode-languageserver-node / addItemLast

Method addItemLast

jsonrpc/src/linkedMap.ts:212–223  ·  view source on GitHub ↗
(item: Item<K, V>)

Source from the content-addressed store, hash-verified

210 }
211
212 private addItemLast(item: Item<K, V>): void {
213 // First time Insert
214 if (!this._head && !this._tail) {
215 this._head = item;
216 } else if (!this._tail) {
217 throw new Error('Invalid list');
218 } else {
219 item.previous = this._tail;
220 this._tail.next = item;
221 }
222 this._tail = item;
223 }
224
225 private removeItem(item: Item<K, V>): void {
226 if (item === this._head && item === this._tail) {

Callers 1

setMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected