59 bytes, text/x-review-board-request
The supplementary RTL ranges have the property that it's sufficient to examine the high surrogate to determine if an astral character is RTL. Once 1428771 is fixed, nsBidiUtils::HasRTLChars() should, therefore, use loop by code unit and check each code unit using UCS2_CHAR_IS_BIDI instead of checking for surrogate pairs. Downside: Certain unpaired high surrogates will be classified as RTL. This should not be a practical problem.
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Aside: I intend to SIMD-accelerate this in Rust as part of bug 1402247.
Summary: nsBidiUtils::HasRTLChars() does useless surrogate handling → nsBidiUtils::HasRTLChars() does unnecessary surrogate handling
Comment on attachment 8940990 [details] Bug 1428774 - Avoid surrogate math in HasRTLChars(). https://reviewboard.mozilla.org/r/211268/#review220458 Seems OK -- the potential change in behavior for certain unpaired surrogates might seem a bit fishy, but I can't think of any reason it actually matters here.
Attachment #8940990 - Flags: review?(jfkthame) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/1e903401fe83 Avoid surrogate math in HasRTLChars(). r=jfkthame
You need to log in before you can comment on or make changes to this bug.