Skip to content

Commit

Permalink
fix bug in concatBufs
Browse files Browse the repository at this point in the history
  • Loading branch information
wgreenberg committed Jan 18, 2025
1 parent 0603360 commit a2b09a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Common/Unity/AssetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import { rust } from '../../rustlib.js';
import { assert, assertExists, fallbackUndefined } from '../../util.js';

function concatBufs(a: Uint8Array<ArrayBuffer>, b: Uint8Array<ArrayBuffer>): Uint8Array<ArrayBuffer> {
const origByteLength = a.byteLength;
const newBuffer = a.buffer.transfer(a.byteLength + b.byteLength);
const result = new Uint8Array(newBuffer);
result.set(b, a.byteLength);
result.set(b, origByteLength);
return result;
}

Expand Down

0 comments on commit a2b09a3

Please sign in to comment.