Skip to content

Commit

Permalink
chore(core): update comments and remove a raw numeric literal
Browse files Browse the repository at this point in the history
- per review comments

Fixes: #9467

Co-authored-by: rc-swag <58423624+rc-swag@users.noreply.github.com>
  • Loading branch information
srl295 and rc-swag committed Jun 13, 2024
1 parent 51172c3 commit 263d0e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions core/src/util_normalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion core/src/util_normalize_table_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 263d0e3

Please sign in to comment.