You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by da...@apache.org on 2007/08/04 16:50:57 UTC

svn commit: r562727 - /apr/apr-util/trunk/dbm/apr_dbm_sdbm.c

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",