From: Christophe Jaillet <jailletc36@apache.org>
Date: Tue, 8 Sep 2015 03:14:34 +0000 (+0000)
Subject: In order to save a few cycles, delay a hash table lookup which is not necessary needed
X-Git-Tag: 2.5.0-alpha~2862
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27f8ab24e188cf1cc37969d399d6a70111cefc0c;p=apache

In order to save a few cycles, delay a hash table lookup which is not necessary needed

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

diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c
index 3d4b1ec3d8..8d4f64a2bd 100644
--- a/modules/dav/main/util.c
+++ b/modules/dav/main/util.c
@@ -1823,10 +1823,11 @@ DAV_DECLARE(void) dav_add_vary_header(request_rec *in_req,
      * so only do this check if there is a versioning provider */
     if (vsn_hooks != NULL) {
         const char *target = apr_table_get(in_req->headers_in, DAV_LABEL_HDR);
-        const char *vary = apr_table_get(out_req->headers_out, "Vary");
 
         /* If Target-Selector specified, add it to the Vary header */
         if (target != NULL) {
+            const char *vary = apr_table_get(out_req->headers_out, "Vary");
+
             if (vary == NULL)
                 vary = DAV_LABEL_HDR;
             else