[m-rev.] for review: improve hash tables

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Jul 19 15:34:15 AEST 2010


On Mon, 19 Jul 2010, Julien Fischer wrote:

>> set(!.HT, K, V) = !:HT :-
>>     H = find_slot(!.HT, K),
>> -    AL0 = !.HT ^ buckets ^ elem(H),
>> -    ( if assoc_list.remove(AL0, K, _, AL1) then
>> -        AL = [K - V | AL1],
>> +    Buckets0 = !.HT ^ buckets,
>> +    array.unsafe_lookup(Buckets0, H, AL0),
>
> As a matter of style, I think that calls to unsafe operations should
> have a comment explaining *why* there is safe**.

I meant:

... explaining why _they are_ safe.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list