[erlang-bugs] Bug in gb_trees ? Integer key not found.
Anthony Ramine
nox@REDACTED
Tue May 10 07:43:41 CEST 2011
Le 10 mai 2011 à 00:30, Kostis Sagonas a écrit :
> 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
Sounds like I forgot to type the most important part of the mail. Shouldn't this sort of nasty trick where the rationale tend to be undocumented and forgotten really fast be avoided in the crucial parts of OTP?
--
Anthony Ramine
Dev:Extend
http://dev-extend.eu
More information about the erlang-bugs
mailing list