@@ -239,31 +239,40 @@ struct bool_trie {
239239 constexpr bool lookup(char32_t u) const {
240240 std::uint32_t c = u;
241241 if(c < 0x800) {
242- if constexpr(r1_s == 0)
242+ if constexpr(r1_s == 0) {
243243 return false;
244- return trie_range_leaf(c, r1[c >> 6]);
244+ } else {
245+ return trie_range_leaf(c, r1[c >> 6]);
246+ }
245247 } else if(c < 0x10000) {
246- if constexpr(r3_s == 0)
248+ if constexpr(r3_s == 0) {
247249 return false;
248- std::size_t i = ((c >> 6) - 0x20);
249- auto child = 0;
250- if(i >= r2_t_f && i < r2_t_f + r2_s)
251- child = r2[i - r2_t_f];
252-
253- return trie_range_leaf(c, r3[child]);
250+ } else {
251+ std::size_t i = ((c >> 6) - 0x20);
252+ auto child = 0;
253+ if(i >= r2_t_f && i < r2_t_f + r2_s)
254+ child = r2[i - r2_t_f];
255+ return trie_range_leaf(c, r3[child]);
256+ }
254257 } else {
255- if constexpr(r6_s == 0)
258+ if constexpr(r6_s == 0) {
256259 return false;
260+ }
257261 std::size_t i4 = (c >> 12) - 0x10;
258262 auto child = 0;
259- if(i4 >= r4_t_f && i4 < r4_t_f + r4_s)
260- child = r4[i4 - r4_t_f];
261-
263+ if constexpr(r4_s > 0) {
264+ if(i4 >= r4_t_f && i4 < r4_t_f + r4_s) {
265+ child = r4[i4 - r4_t_f];
266+ }
267+ }
262268
263269 std::size_t i5 = (child << 6) + ((c >> 6) & 0x3f);
264270 auto leaf = 0;
265- if(i5 >= r5_t_f && i5 < r5_t_f + r5_s)
266- leaf = r5[i5 - r5_t_f];
271+ if constexpr(r5_s > 0) {
272+ if(i5 >= r5_t_f && i5 < r5_t_f + r5_s) {
273+ leaf = r5[i5 - r5_t_f];
274+ }
275+ }
267276 return trie_range_leaf(c, r6[leaf]);
268277 }
269278 }
@@ -9681,4 +9690,4 @@ constexpr bool is_unknown(binary_prop s)
96819690 return s == binary_prop::unknown;
96829691}
96839692
9684- } // namespace uni::detail
9693+ } // namespace uni::detail
0 commit comments