mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
perf(ext/web): flatten op arguments for text_encoding (#15723)
This commit is contained in:
parent
73b4597dec
commit
0abf5a412b
2 changed files with 20 additions and 47 deletions
|
@ -125,24 +125,22 @@
|
|||
}
|
||||
|
||||
if (!options.stream && this.#rid === null) {
|
||||
return ops.op_encoding_decode_single(input, {
|
||||
label: this.#encoding,
|
||||
fatal: this.#fatal,
|
||||
ignoreBom: this.#ignoreBOM,
|
||||
});
|
||||
return ops.op_encoding_decode_single(
|
||||
input,
|
||||
this.#encoding,
|
||||
this.#fatal,
|
||||
this.#ignoreBOM,
|
||||
);
|
||||
}
|
||||
|
||||
if (this.#rid === null) {
|
||||
this.#rid = ops.op_encoding_new_decoder({
|
||||
label: this.#encoding,
|
||||
fatal: this.#fatal,
|
||||
ignoreBom: this.#ignoreBOM,
|
||||
});
|
||||
this.#rid = ops.op_encoding_new_decoder(
|
||||
this.#encoding,
|
||||
this.#fatal,
|
||||
this.#ignoreBOM,
|
||||
);
|
||||
}
|
||||
return ops.op_encoding_decode(input, {
|
||||
rid: this.#rid,
|
||||
stream: options.stream,
|
||||
});
|
||||
return ops.op_encoding_decode(input, this.#rid, options.stream);
|
||||
} finally {
|
||||
if (!options.stream && this.#rid !== null) {
|
||||
core.close(this.#rid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue