MCPcopy
hub / github.com/chartjs/Chart.js / garbageCollect

Function garbageCollect

src/core/core.scale.js:71–83  ·  view source on GitHub ↗

* @param {object} caches * @param {number} length

(caches, length)

Source from the content-addressed store, hash-verified

69 * @param {number} length
70 */
71function garbageCollect(caches, length) {
72 each(caches, (cache) => {
73 const gc = cache.gc;
74 const gcLen = gc.length / 2;
75 let i;
76 if (gcLen > length) {
77 for (i = 0; i < gcLen; ++i) {
78 delete cache.data[gc[i]];
79 }
80 gc.splice(0, gcLen);
81 }
82 });
83}
84
85/**
86 * @param {object} options

Callers 1

_computeLabelSizesMethod · 0.85

Calls 1

eachFunction · 0.85

Tested by

no test coverage detected