Re: [RFC] B+Tree library V2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: =?utf-8?B?SsO2cm4=?= Engel
Date: Thursday, January 8, 2009 - 1:02 pm

On Thu, 8 January 2009 18:10:01 +0100, Johannes Berg wrote:

[ Changed the function name above.  It really isn't a lookup, it returns
a key, not a value.  My fault. ]

Looks correct otherwise.  Probably needs a comment that without "tmp" we
would skip a 0 key.  Or am I the only one who wants to simplify the code
before spotting this little subtlety?


Not sure what you mean.  Something with the same effect as this?

#define btree_for_each_val(head, geo, key, val)				\
	 for (key = btree_last(head, geo),				\
	 		val = btree_lookup(head, geo, key);		\
	 		val;						\
			key = btree_get_prev_key(head, geo, key),	\
			val = btree_lookup(head, geo, key))

Jörn

-- 
Time? What's that? Time is only worth what you do with it.
-- Theo de Raadt
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] B+Tree library, Jörn, (Sun Oct 26, 5:46 am)
Re: [RFC] B+Tree library, Dave Chinner, (Mon Oct 27, 6:25 pm)
Re: [RFC] B+Tree library, Pavel Machek, (Thu Oct 30, 10:43 am)
Re: [RFC] B+Tree library, Jörn, (Thu Oct 30, 10:58 am)
Re: [RFC] B+Tree library, Pavel Machek, (Thu Oct 30, 12:14 pm)
Re: [RFC] B+Tree library, Jörn, (Thu Oct 30, 1:20 pm)
Re: [RFC] B+Tree library, Christian Borntraeger, (Thu Oct 30, 11:38 pm)
Re: [RFC] B+Tree library, Jörn, (Fri Oct 31, 12:35 am)
Re: [RFC] B+Tree library, Geert Uytterhoeven, (Fri Oct 31, 2:16 am)
Re: [RFC] B+Tree library, Jörn, (Fri Oct 31, 2:20 am)
Re: [RFC] B+Tree library, Johannes Berg, (Fri Oct 31, 3:35 am)
Re: [RFC] B+Tree library, Jörn, (Fri Oct 31, 4:26 am)
Re: [RFC] B+Tree library, Johannes Berg, (Fri Oct 31, 4:32 am)
Re: [RFC] B+Tree library, Jörn, (Fri Oct 31, 5:54 am)
Re: [RFC] B+Tree library, Johannes Berg, (Fri Oct 31, 6:07 am)
Re: [RFC] B+Tree library, Jörn, (Fri Oct 31, 6:15 am)
Re: [RFC] B+Tree library, Johannes Berg, (Fri Oct 31, 6:16 am)
Re: [RFC] B+Tree library, Jörn, (Fri Oct 31, 6:29 am)
Re: [RFC] B+Tree library, Bert Wesarg, (Fri Oct 31, 6:45 am)
Re: [RFC] B+Tree library, Tim Gardner, (Fri Oct 31, 8:18 am)
Re: [RFC] B+Tree library, Jörn, (Fri Oct 31, 8:35 am)
Re: [RFC] B+Tree library, Sean Young, (Fri Oct 31, 1:17 pm)
Re: [RFC] B+Tree library, Jörn, (Fri Oct 31, 4:36 pm)
Re: [RFC] B+Tree library, Sean Young, (Sat Nov 1, 3:17 am)
[RFC] B+Tree library V2, Jörn, (Sat Nov 1, 8:59 am)
Re: [RFC] B+Tree library V2, Johannes Berg, (Wed Nov 5, 12:57 pm)
Re: [RFC] B+Tree library V2, Jörn, (Wed Nov 5, 1:06 pm)
Re: [RFC] B+Tree library V2, Johannes Berg, (Wed Nov 5, 1:12 pm)
Re: [RFC] B+Tree library V2, Jörn, (Wed Nov 5, 1:21 pm)
Re: [RFC] B+Tree library V2, Johannes Berg, (Wed Nov 5, 1:25 pm)
Re: [RFC] B+Tree library V2, Jörn, (Fri Nov 7, 12:52 am)
Re: [RFC] B+Tree library V2, Johannes Berg, (Wed Jan 7, 5:57 pm)
Re: [RFC] B+Tree library V2, =?utf-8?B?SsO2cm4=?= ..., (Thu Jan 8, 9:24 am)
Re: [RFC] B+Tree library V2, Johannes Berg, (Thu Jan 8, 9:34 am)
Re: [RFC] B+Tree library V2, Johannes Berg, (Thu Jan 8, 9:50 am)
Re: [RFC] B+Tree library V2, Johannes Berg, (Thu Jan 8, 10:10 am)
Re: [RFC] B+Tree library V2, =?utf-8?B?SsO2cm4=?= ..., (Thu Jan 8, 12:40 pm)
Re: [RFC] B+Tree library V2, =?utf-8?B?SsO2cm4=?= ..., (Thu Jan 8, 12:46 pm)
Re: [RFC] B+Tree library V2, =?utf-8?B?SsO2cm4=?= ..., (Thu Jan 8, 1:02 pm)
Re: [RFC] B+Tree library V2, Johannes Berg, (Thu Jan 8, 1:18 pm)
Re: [RFC] B+Tree library V2, =?utf-8?B?SsO2cm4=?= ..., (Thu Jan 8, 2:09 pm)