Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(op_crates/web): Remove unused code path in TextEncoder #10104

Merged
merged 1 commit into from
Apr 11, 2021

Conversation

tarruda
Copy link
Contributor

@tarruda tarruda commented Apr 10, 2021

According to https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder, TextEncoder should ignore the "encoding" parameter and always use "utf-8". It seems the current implementation already uses "utf-8" unconditionally.

Even if it didn't, a JS implementation of UTF-8 encoding is used, so it is better to leave only the rust implementation which is more efficient.

According to
https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder,
TextEncoder should ignore the "encoding" parameter and always use
"utf-8". It seems the current implementation already uses "utf-8"
unconditionally.

Even if it didn't, a JS implementation of UTF-8 encoding is used, so it
is better to leave only the rust implementation which is more efficient.
@CLAassistant
Copy link

CLAassistant commented Apr 10, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Does anyone have any concern? cc @nayeemrmn @lucacasonato @bartlomieju

BTW this condition (this.encoding === "utf-8) was introduced in #3596

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants