MCPcopy
hub / github.com/processing/p5.js / ensureLength

Method ensureLength

src/webgl/p5.DataArray.js:74–80  ·  view source on GitHub ↗

* Expand capacity of the internal storage until it can fit a target size

(target)

Source from the content-addressed store, hash-verified

72 * Expand capacity of the internal storage until it can fit a target size
73 */
74 ensureLength(target) {
75 while (this.data.length < target) {
76 const newData = new Float32Array(this.data.length * 2);
77 newData.set(this.data, 0);
78 this.data = newData;
79 }
80 }
81};
82
83function dataArray(p5, fn){

Callers 1

pushMethod · 0.95

Calls 1

setMethod · 0.45

Tested by

no test coverage detected