servo / unicode-bidi

Implementation of the Unicode Bidirection Algorithm in Rust
Other
74 stars 34 forks source link

Use a simplified codepath if no bidi isolation controls are present. #131

Closed jfkthame closed 4 months ago

jfkthame commented 4 months ago

If there aren't any bidi isolation control characters in the paragraph, each level run directly corresponds to one isolating run sequence. (See notes under https://www.unicode.org/reports/tr9/#BD13.) In this case we can take a simplified codepath to process them.

Also, we can avoid the need for a separate pass over the levels array to find level runs by collecting the level runs at the same time as the levels array is being set up, during explicit::compute().