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

Peter Wang novalazy at gmail.com
Mon Mar 25 12:44:09 AEDT 2024


On Mon, 25 Mar 2024 02:20:01 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> Further improve string.m.
> 
> library/string.m:
>     Use variable names that give more info about their meaning, such as
>     specify whether the code units they refer to are utf8 or utf16.
> 
>     Fix unnecessary differences between the variable names used in related
>     predicates/functions/
> 
>     Give some predicates more descriptive names.
> 
>     Add some explicit module qualifications.

> diff --git a/library/string.m b/library/string.m
> index 41f56bb09..9937aabac 100644
> --- a/library/string.m
> +++ b/library/string.m

> @@ -3748,8 +3758,8 @@ sub_string_search_start(WholeString, Pattern, BeginAt, Index) :-
>  ").
>  
>  unsafe_sub_string_search_start(String, SubString, BeginAt, Index) :-
> -    Len = length(String),
> -    SubLen = length(SubString),
> +    Len = string.length(String),
> +    SubLen = tringength(SubString),

I've fixed this.

Peter


More information about the reviews mailing list