This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 681b867
committed
Auto merge of rust-lang#125129 - cuviper:branchless-len_utf8, r=<try>
Remove the branches from `len_utf8`
This changes `len_utf8` to add all of the range comparisons together,
rather than branching on each one. We should definitely test performance
though, because it's possible that this will pessimize mostly-ascii
inputs that would have had a short branch-predicted path before.1 file changed
+1
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1741 | 1741 | | |
1742 | 1742 | | |
1743 | 1743 | | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | 1744 | | |
1749 | | - | |
| 1745 | + | |
1750 | 1746 | | |
1751 | 1747 | | |
1752 | 1748 | | |
| |||
0 commit comments