You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/07/26 18:36:04 UTC
svn commit: r1507366 - /subversion/trunk/subversion/include/svn_hash.h
Author: breser
Date: Fri Jul 26 16:36:04 2013
New Revision: 1507366
URL: http://svn.apache.org/r1507366
Log:
Fix possible duplication of work when using svn_hash_gets() macro.
This is similar to the situation described about svn_hash_sets() in
r1507155. However, we can't use the fix used there because svn_hash_gets()
has a return value. This essentially roles back the opportunity for the
compiler to optimize the strlen() call when the key is a literal string. It
also puts svn_hash_gets() back to the same implementation it had in r1443387.
* subversion/include/svn_hash.h
(svn_hash_gets): Use APR_HASH_KEY_STRING as length.
Modified:
subversion/trunk/subversion/include/svn_hash.h
Modified: subversion/trunk/subversion/include/svn_hash.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_hash.h?rev=1507366&r1=1507365&r2=1507366&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_hash.h (original)
+++ subversion/trunk/subversion/include/svn_hash.h Fri Jul 26 16:36:04 2013
@@ -245,7 +245,7 @@ svn_hash_from_cstring_keys(apr_hash_t **
* @since New in 1.8.
*/
#define svn_hash_gets(ht, key) \
- apr_hash_get(ht, key, strlen(key))
+ apr_hash_get(ht, key, APR_HASH_KEY_STRING)
/** Shortcut for apr_hash_set() with a const char * key.
*