Date: Wed, 12 Aug 2015 19:35:41 +0100 From: Bruce Simpson <bms@fastmail.net> To: Baptiste Daroussin <bapt@freebsd.org>, Davide Italiano <davide@freebsd.org> Cc: "src-committers@freebsd.org" <src-committers@freebsd.org>, svn-src-projects@freebsd.org Subject: Re: svn commit: r286484 - projects/collation/usr.bin/localedef Message-ID: <55CB91FD.8000004@fastmail.net> In-Reply-To: <20150812182739.GB51754@ivaldir.etoilebsd.net> References: <201508082257.t78MvIT1000841@repo.freebsd.org> <CACYV=-GnOpPddd-x_J0yW4g4QFsdcEVXaVc9CER9JD7iObGzAg@mail.gmail.com> <20150812182739.GB51754@ivaldir.etoilebsd.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12/08/15 19:27, Baptiste Daroussin wrote: > On Wed, Aug 12, 2015 at 01:22:17PM -0400, Davide Italiano wrote: >>> +#define RB_NUMNODES(type, name, head, cnt) do { \ >>> + type *t; \ >>> + cnt = 0; \ >>> + RB_FOREACH(t, name, head) { \ >>> + cnt++; \ >>> + } \ >>> +} while (0); >>> + >> >> Can you commit this one to HEAD && move it to the right header? >> > You mean adding to tree(3)? Not sure why you'd want to pollute it by doing this. The macro is simple enough that anyone can write it, and it is often best to count RB nodes whilst doing something else (or lazy-update) to avoid unnecessary traversals.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55CB91FD.8000004>