MCPcopy Index your code
hub / github.com/microsoft/vscode-languageserver-node / removeItem

Method removeItem

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

Source from the content-addressed store, hash-verified

223 }
224
225 private removeItem(item: Item<K, V>): void {
226 if (item === this._head && item === this._tail) {
227 this._head = undefined;
228 this._tail = undefined;
229 }
230 else if (item === this._head) {
231 this._head = item.next;
232 }
233 else if (item === this._tail) {
234 this._tail = item.previous;
235 }
236 else {
237 const next = item.next;
238 const previous = item.previous;
239 if (!next || !previous) {
240 throw new Error('Invalid list');
241 }
242 next.previous = previous;
243 previous.next = next;
244 }
245 }
246
247 private touch(item: Item<K, V>, touch: Touch): void {
248 if (!this._head || !this._tail) {

Callers 2

deleteMethod · 0.95
shiftMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected