Messages in this thread | | | Date | Thu, 8 Jan 2009 20:46:38 +0100 | From | Jörn Engel <> | Subject | Re: [RFC] B+Tree library V2 |
| |
On Thu, 8 January 2009 17:50:04 +0100, Johannes Berg wrote: > > I see this: > > > - * Second trick is to special-case the key "0" or NUL. As seen above, this > - * value indicates an unused slot, so such a value should not be stored in the > - * tree itself. Instead it is stored in the null_ptr field in the btree_head. > > Does that mean that wasn't true, and I can store a 0 key?
Ahh, don't look at that! The embarrassment is unbearable! Go away!
Yes, I used to have a special exception for a 0 key. But I also have a special exception for a NULL value and can test against that instead of testing against a 0 key. It is even faster, because the value is not variable-sized. In hindsight it is hard to explain why I ever did that.
Jörn
-- Unless something dramatically changes, by 2015 we'll be largely wondering what all the fuss surrounding Linux was really about. -- Rob Enderle -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |