[erlang-bugs] Bug in gb_trees ? Integer key not found.

Kostis Sagonas <>
Tue May 10 00:30:06 CEST 2011


Anthony Ramine wrote:
> Le 9 mai 2011 à 23:56, Kostis Sagonas a écrit :
> 
>> <aside>
>> Note that the two calls might have different semantics actually:
>>
>>   1> orddict:from_list([{2,a},{1,b},{2,a},{3,c}]).
>>   [{1,b},{2,a},{3,c}]
>>   2> lists:sort([{2,a},{1,b},{2,a},{3,c}]).
>>   [{1,b},{2,a},{2,a},{3,c}]
>> </aside>
>>
>> Is this call to lists:sort/1 correct/intentional?  Only the original developer can answer such questions, if he happens to still recall whether this was done just to save a millisecond or for some other reason...  God only knows how many possible subtle bugs may be hidden in such (or similar) code.
> 
> lists:ukeysort/2 removes duplicates.

Right, I know. So does lists:usort/1.

And your point is what exactly?

Kostis


More information about the erlang-bugs mailing list