Commit cc863f0
committed
Improve
The comparison can be performed on the raw bytes, as the chars can
only match if their UTF8 encoding matches.
This avoids the `is_char_boundary` checks and translates to a straight
`u8` slice comparison which is optimized to a memcmp or inline
comparison where appropriate.str prefix/suffix comparison1 parent ddca1e0 commit cc863f0
1 file changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
718 | | - | |
719 | | - | |
| 718 | + | |
720 | 719 | | |
721 | 720 | | |
722 | 721 | | |
723 | 722 | | |
724 | 723 | | |
725 | | - | |
726 | | - | |
727 | | - | |
| 724 | + | |
728 | 725 | | |
729 | 726 | | |
730 | 727 | | |
| |||
0 commit comments