Skip to content

Commit

Permalink
🐪
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Dec 13, 2024
1 parent 24ec66f commit 3decf2c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions icu4c/source/test/intltest/rbbitst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1716,16 +1716,16 @@ class RemapRule : public SegmentationRule {
// which has the same properties for all but line breaking, and the
// same behaviour in line breaking (lb=SG and lb=XX are both treated
// as lb=AL).
std::optional<int32_t> trailing_lead;
std::optional<int32_t> trailingLead;
if (result.length() > 0 && U16_IS_LEAD(result[result.length() - 1])) {
trailing_lead = result.length() - 1;
trailingLead = result.length() - 1;
}

matcher->appendReplacement(result, replacement_, status);

if (trailing_lead && *trailing_lead + 1 < result.length() &&
U16_IS_TRAIL(result[*trailing_lead + 1])) {
result.setCharAt(*trailing_lead, u'\uFFFF');
if (trailingLead && *trailingLead + 1 < result.length() &&
U16_IS_TRAIL(result[*trailingLead + 1])) {
result.setCharAt(*trailingLead, u'\uFFFF');
}

if (matcher->start(status) + offset > 0 &&
Expand All @@ -1742,14 +1742,14 @@ class RemapRule : public SegmentationRule {
*resolved[i].indexInRemapped += offset;
}

std::optional<int32_t> trailing_lead;
std::optional<int32_t> trailingLead;
if (result.length() > 0 && U16_IS_LEAD(result[result.length() - 1])) {
trailing_lead = result.length() - 1;
trailingLead = result.length() - 1;
}
matcher->appendTail(result);
if (trailing_lead && *trailing_lead + 1 < result.length() &&
U16_IS_TRAIL(result[*trailing_lead + 1])) {
result.setCharAt(*trailing_lead, u'\uFFFF');
if (trailingLead && *trailingLead + 1 < result.length() &&
U16_IS_TRAIL(result[*trailingLead + 1])) {
result.setCharAt(*trailingLead, u'\uFFFF');
}

if (resolved.back().indexInRemapped != result.length()) {
Expand Down

0 comments on commit 3decf2c

Please sign in to comment.