]> granicus.if.org Git - apache/commitdiff
minor optimization.
authorAndré Malo <nd@apache.org>
Thu, 24 Jul 2003 19:50:45 +0000 (19:50 +0000)
committerAndré Malo <nd@apache.org>
Thu, 24 Jul 2003 19:50:45 +0000 (19:50 +0000)
this avoids a variable on stack and some internal
pointer operations.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100774 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_rewrite.c

index a0d8204734828dbfaccf0fd62ceeb6704f762c64..b1fad04bee3da6276f29ae085ab21df9b4b6e1bf 100644 (file)
@@ -898,15 +898,15 @@ static const char *cmd_parseflagfield(apr_pool_t *p, void *cfg, char *key,
                                                            void *,
                                                            char *, char *))
 {
-    apr_size_t last = strlen(key) - 1;
     char *val, *nextp, *endp;
     const char *err;
 
-    if (*key != '[' || key[last] != ']') {
+    endp = key + strlen(key) - 1;
+    if (*key != '[' || *endp != ']') {
         return "RewriteCond: bad flag delimiters";
     }
 
-    key[last] = ','; /* for simpler parsing */
+    *endp = ','; /* for simpler parsing */
     ++key;
 
     while (*key) {