Skip to content

base: Rework UTF-8/16/32 offset/length wrapper types - #46742

Merged
mrobinson merged 1 commit into
servo:mainfrom
SimonSapin:utf-offsets
Jul 23, 2026
Merged

base: Rework UTF-8/16/32 offset/length wrapper types#46742
mrobinson merged 1 commit into
servo:mainfrom
SimonSapin:utf-offsets

Conversation

@SimonSapin

Copy link
Copy Markdown
Member
  • Rename Utf*CodeUnitLength to Utf*CodeUnits since it can be used for offsets as well as lengths
  • Move free function conversions to methods
  • Optimize conversions by matching UTF-8 bit patterns instead of decoding UTF-8 to chars.

Following up on #46698

Testing: expecting no change to existing tests

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 23, 2026
* Rename `Utf*CodeUnitLength` to `Utf*CodeUnits` since it can be used for offsets as well as lengths
* Move free function conversions to methods
* Optimize conversions by matching UTF-8 bit patterns instead of decoding UTF-8 to `char`s.

Signed-off-by: Simon Sapin <simon@igalia.com>
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jul 23, 2026
@mrobinson mrobinson changed the title Rework UTF-8/16/32 offset/length wrapper types base: Rework UTF-8/16/32 offset/length wrapper types Jul 23, 2026
@mrobinson
mrobinson added this pull request to the merge queue Jul 23, 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 Jul 23, 2026
Merged via the queue into servo:main with commit cc74ff6 Jul 23, 2026
32 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 Jul 23, 2026
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