[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Global replace: apr_hash_get/set(APR_HASH_KEY_STRING) -> svn_hash_get/set()

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 11 Feb 2013 16:32:52 +0000 (GMT)

I just noticed that in r1443387, Bert added:

/* Shortcut for apr_hash_get() with a const char * key.
 *
 * @since New in 1.8.
 */
#define svn_hash_gets(ht, key) \
            apr_hash_get(ht, key, APR_HASH_KEY_STRING)
[...]
#define svn_hash_sets(ht, key, val) \
            apr_hash_set(ht, key, APR_HASH_KEY_STRING, val)

and it's now used in a few places.

I like it, as brevity of low-level code is important for readability.  I've had that thought many times but never done it.

In my opinion we should simply replace all apr_hash_get/set(...APR_HASH_KEY_STRING...) with these, before branching 1.8.0, and be done with it, and not have a continuous trickle of changes.

We could bike-shed on the names, as always.  'gets' and 'sets' could imply a
string *value* rather than the key (by analogy with stdlib gets() etc.),
 but they're good enough already -- we'd easily get used to them.

If no objections and nobody else does it, I can do it.

- Julian

--
Certified & Supported Apache Subversion Downloads: http://www.wandisco.com/subversion/download
Received on 2013-02-11 17:33:27 CET

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.