MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / getCache

Method getCache

daemon/src/common/string_cache.ts:51–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 }
50
51 getCache() {
52 const result: T[] = [];
53 let index = this.head;
54 for (let i = 0; i < this.size; i++) {
55 result.push(this.buffer[index]);
56 index = (index + 1) % this.capacity;
57 }
58 const wasDeleted = this.deleted;
59
60 this.head = 0;
61 this.tail = 0;
62 this.size = 0;
63 this.deleted = false;
64
65 return {
66 items: result,
67 wasDeleted
68 };
69 }
70
71 clear(){
72 this.buffer = new Array(this.capacity);

Callers 1

flushOutputBufferMethod · 0.80

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected