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

PAILLEAU Eric eric.pailleau@REDACTED
Mon May 9 22:01:38 CEST 2011


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

> gb_trees:lookup(a1,T).
{value,10}

> f().
ok

>  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

While {value, a1} would be expected.

In documentation :  Key = Val = Term() .
No restriction for key is documented : so a lack of documentation or a
bug ...

Regards.





More information about the erlang-bugs mailing list