babylonjs-serializers 5.43.0 → 5.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4384,11 +4384,10 @@ var _BinaryWriter = /** @class */ (function () {
4384
4384
  */
4385
4385
  _BinaryWriter.prototype._resizeBuffer = function (byteLength) {
4386
4386
  var newBuffer = new ArrayBuffer(byteLength);
4387
- var oldUint8Array = new Uint8Array(this._arrayBuffer);
4387
+ var copyOldBufferSize = Math.min(this._arrayBuffer.byteLength, byteLength);
4388
+ var oldUint8Array = new Uint8Array(this._arrayBuffer, 0, copyOldBufferSize);
4388
4389
  var newUint8Array = new Uint8Array(newBuffer);
4389
- for (var i = 0, length_10 = newUint8Array.byteLength; i < length_10; ++i) {
4390
- newUint8Array[i] = oldUint8Array[i];
4391
- }
4390
+ newUint8Array.set(oldUint8Array, 0);
4392
4391
  this._arrayBuffer = newBuffer;
4393
4392
  this._dataView = new DataView(this._arrayBuffer);
4394
4393
  return newBuffer;