[ccan] Help using htable

Rusty Russell rusty at rustcorp.com.au
Tue Mar 20 11:00:29 EST 2012


On Wed, 7 Mar 2012 12:05:39 +0100, Zoltán Lajos Kis <zoltan.lajos.kis at ericsson.com> wrote:
> Hi,
> 
> I'm trying to use the htable module, but experiencing some strange behaviors.
> When I add an element with hash key 0 or 1 to the table, it does not get inserted to the table; only the element counter is increased.
> Any idea what is going wrong? Test code below...

Hi Zoltan!

        Sorry for the delay... this got caught in the non-subscriber
filter for the list, along with the spam.  Then I saw it, with your
excellent test case, and fixed the problem.  Only now am I replying :)

Yes, if the initial value in the htable has a zero (or 1) hash value,
there was a bug.  This is now fixed, as per the commit below:

commit 0b93bd102aad6b61f1e569fb12aabc6352a1d7cd
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Fri Mar 9 13:20:35 2012 +1030

    htable: fix bug where first entry has hash of 0 or 1.
    
    Thanks to Zoltán Lajos Kis for the bug report and test case!

Thanks!
Rusty.
-- 
  How could I marry someone with more hair than me?  http://baldalex.org


More information about the ccan mailing list