[m-rev.] for post-commit review: style improvements in bitmap.m

Peter Wang novalazy at gmail.com
Tue Dec 20 11:07:55 AEDT 2022


On Mon, 19 Dec 2022 23:34:50 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> Update bitmap.m's programming style.
> 
> library/bitmap.m:
>     Factor out repeated code.
> 
>     Use predicate versions of operations over function versions.
> 
>     Avoid advertising field access notation.
> 
>     Fix module name in exception messages.

> @@ -2073,7 +2069,7 @@ do_read_bitmap_range(Stream, Start, NumBytes, !Bitmap, !BytesRead,
>          read_byte_val(input_stream(Stream), ResultCode, Byte, Error0, !IO),
>          (
>              ResultCode = result_code_ok,
> -            !:Bitmap = !.Bitmap ^ unsafe_byte(Start) := Byte,
> +            !Bitmap ^ unsafe_byte(Start) := Byte,

I've changed this to use unsafe_set_byte.

The rest is fine.

Peter


More information about the reviews mailing list