From: Amos Jeffries Date: Mon, 4 Jun 2012 10:00:44 +0000 (-0600) Subject: Cleanup: remove xcountws() function X-Git-Tag: BumpSslServerFirst.take09~3^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4bbb9e8393e28f854188f7b5f74b4a96e3423316;p=thirdparty%2Fsquid.git Cleanup: remove xcountws() function Reduces dependencies and removes one more unnecessary symbol --- diff --git a/include/util.h b/include/util.h index af0a02842c..43cd026158 100644 --- a/include/util.h +++ b/include/util.h @@ -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) /* diff --git a/lib/util.c b/lib/util.c index 4824b0ce5e..b866f28a84 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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) diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index b0db44e252..40a4f42c3c 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -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;