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

Ulf Wiger <>
Mon May 9 22:12:25 CEST 2011


On 9 May 2011, at 22:01, PAILLEAU Eric wrote:

>> T=gb_trees:from_orddict([{10,a1},{15,a2},{5,a3},{7,a4}]).
> {4,{5,a3,{15,a2,{10,a1,nil,nil},nil},{7,a4,nil,nil}}}
> 
>> gb_trees:lookup(10,T).
> none
> 

The argument is not an orddict.

The reason for the function is speed, obviously, and verifying that the list is in fact ordered would defeat the speed advantage. Thus, it is up to the user to ensure that they actually pass an orddict. This isn't expressly written in the manual...

BR,
Ulf W

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com





More information about the erlang-bugs mailing list