apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r562727 - /apr/apr-util/trunk/dbm/apr_dbm_sdbm.c
Date Sat, 04 Aug 2007 14:50:57 GMT
Author: davi
Date: Sat Aug  4 07:50:56 2007
New Revision: 562727

URL: http://svn.apache.org/viewvc?view=rev&rev=562727
Log:
Simplify SDBM usednames code, we have to copy the string again anyway.

Modified:
    apr/apr-util/trunk/dbm/apr_dbm_sdbm.c

Modified: apr/apr-util/trunk/dbm/apr_dbm_sdbm.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbm/apr_dbm_sdbm.c?view=diff&rev=562727&r1=562726&r2=562727
==============================================================================
--- apr/apr-util/trunk/dbm/apr_dbm_sdbm.c (original)
+++ apr/apr-util/trunk/dbm/apr_dbm_sdbm.c Sat Aug  4 07:50:56 2007
@@ -202,18 +202,9 @@
 static void vt_sdbm_usednames(apr_pool_t *pool, const char *pathname,
                               const char **used1, const char **used2)
 {
-    char *work;
-
-    /* ### this could be optimized by computing strlen() once and using
-       ### memcpy and pmemdup instead. but why bother? */
-
     *used1 = apr_pstrcat(pool, pathname, APR_SDBM_DIRFEXT, NULL);
-    *used2 = work = apr_pstrdup(pool, *used1);
-
-    /* we know the extension is 4 characters */
-    memcpy(&work[strlen(work) - 4], APR_SDBM_PAGFEXT, 4);
+    *used2 = apr_pstrcat(pool, pathname, APR_SDBM_PAGFEXT, NULL);
 }
-
 
 APU_DECLARE_DATA const apr_dbm_type_t apr_dbm_type_sdbm = {
     "sdbm",



Mime
View raw message