* Expand capacity of the internal storage until it can fit a target size
(target)
| 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 | |
| 83 | function dataArray(p5, fn){ |