From 263d0e32f2d43ebe2f551fd3deea4e04bbc8aae3 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 13 Jun 2024 12:17:55 -0500 Subject: [PATCH] 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> --- core/src/util_normalize.cpp | 6 ++++-- core/src/util_normalize_table_generator.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/util_normalize.cpp b/core/src/util_normalize.cpp index 947dbe0f85e..bcdfc1bb3f7 100644 --- a/core/src/util_normalize.cpp +++ b/core/src/util_normalize.cpp @@ -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()); diff --git a/core/src/util_normalize_table_generator.cpp b/core/src/util_normalize_table_generator.cpp index b5895a588bf..994f16d8b37 100644 --- a/core/src/util_normalize_table_generator.cpp +++ b/core/src/util_normalize_table_generator.cpp @@ -55,7 +55,7 @@ write_nfd_table() { // collect the raw list of chars that do NOT have a boundary before them. std::vector 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