[m-rev.] for post-commit review: fix some debug grade test failures
Peter Wang
novalazy at gmail.com
Tue Jun 28 15:52:49 AEST 2022
On Tue, 28 Jun 2022 15:03:47 +1000 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> Speed up trust tests in the declarative debugger.
>
> browser/declarative_oracle.m:
> Optimize table lookups when checking whether a procedure is trusted.
> Instead of doing three separate lookups to test
> diff --git a/browser/declarative_oracle.m b/browser/declarative_oracle.m
> index 8db3cf676..b4fe5404d 100644
> --- a/browser/declarative_oracle.m
> +++ b/browser/declarative_oracle.m
...
> +:- pred remove_trusted_arity(string::in, int::in,
> + map(string, set(int))::in, map(string, set(int))::out) is det.
> +
> +remove_trusted_arity(Name, Arity, !TrustedArityMap) :-
> + map.lookup(!.TrustedArityMap, Name, TrustedArities0),
> + set.det_remove(Arity, TrustedArities0, TrustedArities),
> + map.det_update(Name, TrustedArities, !TrustedArityMap).
If TrustedArities is empty then Name should be deleted from
!TrustedArityMap.
That looks fine, otherwise.
Peter
More information about the reviews
mailing list