Re: [RFC] Simplify use of apr_hash_this()
From: Greg Stein <gstein_at_gmail.com>
Date: Mon, 6 Jul 2009 19:53:36 +0200
On Mon, Jul 6, 2009 at 19:25, Julian Foad<julianfoad_at_btopenworld.com> wrote:
The concept is good, though I'd suggest changing the HI parameter to a
Also...
> I chose the names apr_hash_index_key(), apr_hash_index_klen(),
Those are preprocessor macros, and are easy to *avoid* defining when
That is not the case for functions.
Consider what happens when they become defined in (say) APR 1.5. Now
Not to mention duplicate declaration fiascos.
> The definitions are in svn_types.h, because they are needed throughout
Yes.
> The implementations are in subversion/libsvn_subr/iter.c because,
*shrug*
>...
Yup. Definitely cleaner.
I'd even suggest that in some cases, the intermediate variable can go
const char *value = apr_hash_index_val(hi);
some_function(value);
Could be:
some_function(apr_hash_index_val(hi));
Since the cast will be implied by some_function's prototype.
> Is this a good version that I can go ahead with now?
Not yet :-P
Cheers,
------------------------------------------------------
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.