| 8978 | // CheckJoiners and CheckBidi are true for URL specification. |
| 8979 | |
| 8980 | inline static direction find_direction(uint32_t code_point) noexcept { |
| 8981 | auto it = std::lower_bound( |
| 8982 | std::begin(dir_table), std::end(dir_table), code_point, |
| 8983 | [](const directions& d, uint32_t c) { return d.final_code < c; }); |
| 8984 | |
| 8985 | // next check is almost surely in vain, but we use it for safety. |
| 8986 | if (it == std::end(dir_table)) { |
| 8987 | return direction::NONE; |
| 8988 | } |
| 8989 | // We have that d.final_code >= c. |
| 8990 | if (code_point >= it->start_code) { |
| 8991 | return it->direct; |
| 8992 | } |
| 8993 | return direction::NONE; |
| 8994 | } |
| 8995 | |
| 8996 | inline static size_t find_last_not_of_nsm( |
| 8997 | const std::u32string_view label) noexcept { |
no test coverage detected