Skip to content

script: Reduce String allocation of JS API of fetch Headers - #47530

Merged
Narfinger merged 2 commits into
servo:mainfrom
yezhizhen:fetch
Aug 26, 2026
Merged

Narfinger merged 2 commits into
servo:mainfrom
yezhizhen:fetch

Conversation

@yezhizhen

@yezhizhen yezhizhen commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

We modify validated name in-place instead.
Testing: Covered by existing tests. Tho I have not tested as it's trivial.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
@yezhizhen
yezhizhen requested a review from gterzian as a code owner August 26, 2026 05:54
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 26, 2026
};

valid_name = valid_name.to_lowercase();
valid_name.make_ascii_lowercase();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is equivalent because we have validated with

x if x > 127 => false, // non-CHARs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should have at least a comment here. Something like: "Tokens are always ascii".

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 26, 2026
@Narfinger
Narfinger enabled auto-merge August 26, 2026 09:54
@Narfinger
Narfinger added this pull request to the merge queue Aug 26, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 26, 2026
Merged via the queue into servo:main with commit 91eb2b0 Aug 26, 2026
33 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Aug 26, 2026
@yezhizhen
yezhizhen deleted the fetch branch August 27, 2026 00:55
yezhizhen added a commit to yezhizhen/servo that referenced this pull request Aug 29, 2026
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
…47530)

We modify validated name in-place instead.
Testing: Covered by existing tests. Tho I have not tested as it's
trivial.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
Psychpsyo pushed a commit to Psychpsyo/servo that referenced this pull request Oct 12, 2026
…47530)

We modify validated name in-place instead.
Testing: Covered by existing tests. Tho I have not tested as it's
trivial.

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
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.

3 participants