[m-rev.] for post-commit review: improve string.m

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Mar 26 18:38:34 AEDT 2024


On 2024-03-26 11:20 +11:00 AEDT, "Peter Wang" <novalazy at gmail.com> wrote:
>> diff --git a/library/string.m b/library/string.m
>> index bbf08e1c2..7d0882bad 100644
>> --- a/library/string.m
>> +++ b/library/string.m
>> @@ -2438,7 +2438,8 @@ acc_rev_chars_from_utf8_code_units([A | FollowA], !RevChars) :-
>>          CodePointInt = (A /\ 0x0f) << 12
>>                      \/ (B /\ 0x3f) << 6
>>                      \/ (C /\ 0x3f),
>> -        CodePointInt >= 0x800
>> +        CodePointInt >= 0x800,
>> +        not char.char_int_is_surrogate(CodePointInt)
>>      else if A =< 0xf4 then  % 4-byte sequence
>>          FollowA = [B, C, D | Rest],
>>          utf8_is_trail_byte(B),
> 
> Also update the XXX in from_utf8_code_unit_list.

Done.

I kept the comments. They are not required, but they are
helpful to me.

Thanks for the review.

Zoltan.


More information about the reviews mailing list