Skip to content

Ensure CodePointTrie access by u16 or char omits unnecessary range checks #5819

Open
@hsivonen

Description

@hsivonen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-performanceArea: Performance (CPU, Memory)C-collatorComponent: Collation, normalization

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions