chore(core): update comments and remove a raw numeric literal

- per review comments

Fixes: #9467

Co-authored-by: rc-swag <58423624+rc-swag@users.noreply.github.com>
This commit is contained in:
Steven R. Loomis 2024-06-13 12:17:55 -05:00
parent 51172c3284
commit 263d0e32f2
2 changed files with 5 additions and 3 deletions

View file

@ -228,8 +228,10 @@ bool has_nfd_boundary_before(km_core_usv cp) {
}
/**
* Helper to convert icu::UnicodeString to a UTF-32 km_core_usv buffer,
* nul-terminated
* Helper to convert std::u32string to a UTF-32 km_core_usv buffer,
* nul-terminated.
* Parallel to unicode_string_to_usv()
* @returns new buffer, caller owns storage
*/
km_core_usv *string_to_usv(const std::u32string& src) {
return km::core::kmx::u32dup(src.c_str());

View file

@ -55,7 +55,7 @@ write_nfd_table() {
// collect the raw list of chars that do NOT have a boundary before them.
std::vector<km_core_usv> noBoundary;
for (km_core_usv ch = 0; ch < 0x10FFFF; ch++) {
for (km_core_usv ch = 0; ch < km::core::kmx::Uni_MAX_CODEPOINT; ch++) {
bool bb = nfd->hasBoundaryBefore(ch);
assert(!(ch == 0 && !bb)); // assert that we can use U+0000 as a terminator
if (bb) continue; //only emit nonboundary