apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bp...@pacbell.net>
Subject [PATCH] optimization for apr_pool_userdata_set
Date Thu, 22 Nov 2001 09:03:42 GMT
This patch takes advantage of the recent optimizations to
apr_hash_t's handling of APR_HASH_KEY_STRING to eliminate
a strlen call within apr_pool_userdata_set.

--Brian

Index: srclib/apr/memory/unix/apr_pools.c
===================================================================
RCS file: /home/cvspublic/apr/memory/unix/apr_pools.c,v
retrieving revision 1.116
diff -u -r1.116 apr_pools.c
--- srclib/apr/memory/unix/apr_pools.c    2001/11/21 16:40:54    1.116
+++ srclib/apr/memory/unix/apr_pools.c    2001/11/22 08:48:27
@@ -1294,12 +1294,10 @@
        apr_status_t (*cleanup) (void *),
        apr_pool_t *cont)
 {
-    apr_size_t keylen = strlen(key);
-
     if (cont->prog_data == NULL)
         cont->prog_data = apr_hash_make(cont);
 
-    apr_hash_set(cont->prog_data, key, keylen, data);
+    apr_hash_set(cont->prog_data, key, APR_HASH_KEY_STRING, data);
 
     if (cleanup) {
         apr_pool_cleanup_register(cont, data, cleanup, cleanup);




Mime
View raw message