LibUnicode: Provide string length to ICU string enumeration callbacks

Some callers need the raw nul-terminated c-string in this callback, to
pass to some other ICU method. But other callers will want a StringView.
We know the length already in `icu_string_enumeration_to_list`, so let's
just pass it along to avoid `strlen`.
This commit is contained in:
Timothy Flynn 2025-06-02 15:44:33 -04:00 committed by Shannon Booth
commit 422d72e85d
Notes: github-actions[bot] 2025-06-02 21:04:57 +00:00
3 changed files with 5 additions and 5 deletions

View file

@ -153,7 +153,7 @@ Vector<String> const& available_number_systems()
if (icu_failure(status))
return {};
auto number_systems = icu_string_enumeration_to_list(move(keywords), "nu", [&](char const* keyword) {
auto number_systems = icu_string_enumeration_to_list(move(keywords), "nu", [&](char const* keyword, size_t) {
auto system = adopt_own_if_nonnull(icu::NumberingSystem::createInstanceByName(keyword, status));
if (icu_failure(status))
return false;