Skip to content

Commit 44cf20e

Browse files
committed
fix parameter names
1 parent 6965305 commit 44cf20e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/utils/utf8.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export function safeStringFromCharCode(units: Array<number> | Uint16Array) {
9898
return result;
9999
}
100100

101-
export function utf8Decode(bytes: Uint8Array, outputOffset: number, byteLength: number): string {
102-
let offset = outputOffset;
101+
export function utf8Decode(bytes: Uint8Array, inputOffset: number, byteLength: number): string {
102+
let offset = inputOffset;
103103
const out: Array<number> = [];
104104
const end = offset + byteLength;
105105
while (offset < end) {

src/wasmFunctions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ export function utf8EncodeWasm(str: string, output: Uint8Array, outputOffset: nu
6464
}
6565

6666
// A wrapper function for utf8DecodeToUint16Array()
67-
export function utf8DecodeWasm(bytes: Uint8Array, offset: number, byteLength: number): string {
67+
export function utf8DecodeWasm(bytes: Uint8Array, inputOffset: number, byteLength: number): string {
6868
const inputPtr: pointer = wm.malloc(byteLength);
6969
// in worst case, the UTF-16 array uses the same as byteLength * 2
7070
const outputPtr: pointer = wm.malloc(byteLength * 2);
7171
try {
72-
setMemoryU8(inputPtr, bytes.subarray(offset, offset + byteLength), byteLength);
72+
setMemoryU8(inputPtr, bytes.subarray(inputOffset, inputOffset + byteLength), byteLength);
7373

7474
const outputArraySize = wm.utf8DecodeToUint16Array(outputPtr, inputPtr, byteLength);
7575
const units = new Uint16Array(wm.memory.buffer, outputPtr, outputArraySize);

0 commit comments

Comments
 (0)