diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-28 19:33:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 19:33:52 +0100 |
commit | bdf95c7b72dff27c46849a8ec53f781d1b7af350 (patch) | |
tree | c1400438605805a85434fcca418264a9bbb4b19e | |
parent | 0099c28db35a63678e04b31434d38db52a11c3a5 (diff) |
Revert "perf: use subarray instead of slice in dispatch minimal (#4173)" (#4174)
This reverts commit 0eb91c5591eb7e5e419aa9dbdaff99f5bd8015da.
-rw-r--r-- | cli/js/dispatch_minimal.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/js/dispatch_minimal.ts b/cli/js/dispatch_minimal.ts index 34d5450e8..988cb8af2 100644 --- a/cli/js/dispatch_minimal.ts +++ b/cli/js/dispatch_minimal.ts @@ -27,7 +27,7 @@ export interface RecordMinimal { } export function recordFromBufMinimal(ui8: Uint8Array): RecordMinimal { - const header = ui8.subarray(0, 12); + const header = ui8.slice(0, 12); const buf32 = new Int32Array( header.buffer, header.byteOffset, @@ -40,7 +40,7 @@ export function recordFromBufMinimal(ui8: Uint8Array): RecordMinimal { if (arg < 0) { const kind = result as ErrorKind; - const message = decoder.decode(ui8.subarray(12)); + const message = decoder.decode(ui8.slice(12)); err = { kind, message }; } else if (ui8.length != 12) { throw new errors.InvalidData("BadMessage"); |