]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: remove xcountws() function
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 4 Jun 2012 10:00:44 +0000 (04:00 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 4 Jun 2012 10:00:44 +0000 (04:00 -0600)
Reduces dependencies and removes one more unnecessary symbol

include/util.h
lib/util.c
src/HttpHeader.cc

index af0a02842cdaf982f4bf4bc179b918dea9c735e1..43cd026158083c05bf77915b43f2907c1d686a6d 100644 (file)
@@ -46,7 +46,6 @@
 
 SQUIDCEXTERN int tvSubUsec(struct timeval, struct timeval);
 SQUIDCEXTERN double tvSubDsec(struct timeval, struct timeval);
-SQUIDCEXTERN size_t xcountws(const char *str);
 SQUIDCEXTERN void Tolower(char *);
 #if defined(__cplusplus)
 /*
index 4824b0ce5e48fd154a233840f43031bbbcad9323..b866f28a8481995c4c082cefaf7132f922a94597 100644 (file)
@@ -35,7 +35,6 @@
 #define _etext etext
 
 #include "squid.h"
-#include "profiler/Profiler.h"
 #include "util.h"
 
 #if HAVE_STDIO_H
@@ -79,24 +78,6 @@ tvSubDsec(struct timeval t1, struct timeval t2)
            (double) (t2.tv_usec - t1.tv_usec) / 1000000.0;
 }
 
-/* returns the number of leading white spaces in str; handy in skipping ws */
-size_t
-xcountws(const char *str)
-{
-    size_t count = 0;
-    PROF_start(xcountws);
-
-    if (str) {
-        while (xisspace(*str)) {
-            str++;
-            count++;
-        }
-    }
-
-    PROF_stop(xcountws);
-    return count;
-}
-
 /* somewhat safer calculation of %s */
 double
 xpercent(double part, double whole)
index b0db44e252887eb28afdeb1a0b927cbf0dc77093..40a4f42c3cc6e74a033cf3aabc910ed4fb0bd426 100644 (file)
@@ -1433,7 +1433,7 @@ HttpHeader::getAuth(http_hdr_type id, const char *auth_scheme) const
         return NULL;
 
     /* skip white space */
-    field += xcountws(field);
+    for(; field && xisspace(*field); field++);
 
     if (!*field)               /* no authorization cookie */
         return NULL;