Save a few cycles.
'is_absolute_uri()' returns the length of the prefix, so there is no need to scan
these bytes when looking for a '?' character
@@ -797,12 +797,12 @@ static void splitout_queryargs(request_rec *r, int qsappend, int qsdiscard,
int qslast)
{
char *q;
- int split;
+ int split, skip;
/* don't touch, unless it's a scheme for which a query string makes sense.
* See RFC 1738 and RFC 2368.
*/
- if (is_absolute_uri(r->filename, &split)
+ if ((skip = is_absolute_uri(r->filename, &split))
&& !split) {
r->args = NULL; /* forget the query that's still flying around */
return;
@@ -813,7 +813,7 @@ static void splitout_queryargs(request_rec *r, int qsappend, int qsdiscard,
rewritelog(r, 2, NULL, "discarding query string");
}
- q = qslast ? ap_strrchr(r->filename, '?') : ap_strchr(r->filename, '?');
+ q = qslast ? ap_strrchr(r->filename + skip, '?') : ap_strchr(r->filename + skip, '?');
if (q != NULL) {
char *olduri;
@@ -844,8 +844,6 @@ static void splitout_queryargs(request_rec *r, int qsappend, int qsdiscard,
rewritelog(r, 3, NULL, "split uri=%s -> uri=%s, args=%s", olduri,
r->filename, r->args ? r->args : "<none>");
}
-
- return;
}
/*
