When CodePointTrie of the fast type is queried with u16, the code point cannot be above FAST_TYPE_FAST_INDEXING_MAX. When CodePointTrie (of either type) is queried with char, the code point cannot be above CODE_POINT_MAX.
We should ensure that the relevant branches are omitted in these cases. Perhaps its good enough to ensure this by Godbolting, but actually having separate code for these cases would be robust (not relying on the optimizer reaching a particular conclusion) and obvious.
When
CodePointTrie
of the fast type is queried withu16
, the code point cannot be aboveFAST_TYPE_FAST_INDEXING_MAX
. WhenCodePointTrie
(of either type) is queried withchar
, the code point cannot be aboveCODE_POINT_MAX
.We should ensure that the relevant branches are omitted in these cases. Perhaps its good enough to ensure this by Godbolting, but actually having separate code for these cases would be robust (not relying on the optimizer reaching a particular conclusion) and obvious.