1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 21:50:00 -05:00

Revert "perf: use subarray instead of slice in dispatch minimal (#4173)" (#4174)

This reverts commit 0eb91c5591.
This commit is contained in:
Bartek Iwańczuk 2020-02-28 19:33:52 +01:00 committed by GitHub
parent 0099c28db3
commit bdf95c7b72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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");