[m-rev.] for review: Speed up retrieval of foreign imports.

Peter Wang novalazy at gmail.com
Wed Nov 23 16:58:17 AEDT 2022


On Wed, 23 Nov 2022 13:56:20 +1100 Julien Fischer <jfischer at opturion.com> wrote:
> 
> > diff --git a/compiler/va_map.m b/compiler/va_map.m
> > new file mode 100644
> > index 000000000..6785dfc47
> > --- /dev/null
> > +++ b/compiler/va_map.m
> 
> ...
> 
> > +:- pred maybe_grow_array(int::in, version_array(V)::in, version_array(V)::out)
> > +    is det <= va_map_value(V).
> > +
> > +maybe_grow_array(Slot, Array0, Array) :-
> > +    Size0 = size(Array0),
> 
> s/Size0/Size/

Done.

> 
> > +    ( if Slot >= Size0 then
> > +        NewSize = roundup_array_size(Slot + 1),
> > +        version_array.resize(NewSize, default_value, Array0, Array)
> > +    else
> > +        Array = Array0
> > +    ).
> 
> Use state variables there.

Done.

Peter


More information about the reviews mailing list