]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Check for PURGE method using method enum instead of strcmp()
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 9 May 2014 17:32:25 +0000 (10:32 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 9 May 2014 17:32:25 +0000 (10:32 -0700)
Removes one minor but needless drag on startup and reconfigure speed.

src/acl/MethodData.cc

index 6fad15ef9012f7f0f827c55acf0f33fafac0bad8..dd00ff154646d9f4aa2a9e9971dc57b0e354244c 100644 (file)
@@ -89,9 +89,9 @@ ACLMethodData::parse()
 
     for (Tail = &values; *Tail; Tail = &((*Tail)->next));
     while ((t = strtokFile())) {
-        if (strcmp(t, "PURGE") == 0)
-            ++ThePurgeCount; // configuration code wants to know
         CbDataList<HttpRequestMethod> *q = new CbDataList<HttpRequestMethod> (HttpRequestMethod(t, NULL));
+        if (q->element == Http::METHOD_PURGE)
+            ++ThePurgeCount; // configuration code wants to know
         *(Tail) = q;
         Tail = &q->next;
     }