Use standard string prefix and suffix predicates

Merged
AD
1mo ago
+64-57

Replace the custom prefix/suffix helpers with C++20 starts_with and ends_with. This removes the temporary substring allocation in suffix checks and avoids copying filesystem paths just to inspect their suffix. Preserve the existing make_suffix behavior, including empty suffixes and names already ending in that suffix.

Validation: existing tests plus empty, embedded-NUL, repeated-suffix and path cases; 132,496 generated string pairs compared with the old implementation under GCC and Clang. The removed utils::starts_with/utils::ends_with helpers require out-of-tree callers to use the standard string members.

Depends on #649 for C++20.


Summary by cubic

Replaces the custom utils::starts_with/utils::ends_with helpers with the C++20 standard starts_with and ends_with string members. This removes the temporary substring allocation in old suffix checks and avoids copying filesystem paths just to inspect their suffix. make_suffix and remove_suffix behavior is preserved, including empty suffixes, embedded NULs, repeated suffixes, and names already ending in that suffix. Also brings in updates merged from the C++20 parent branch, including SDSL changes, packed counter lock sharding, and dependency configuration cleanup.

Migration

  • Out-of-tree callers of the removed utils::starts_with/utils::ends_with helpers must use the standard string members.