From: Francesco Chemolli Date: Tue, 4 Feb 2014 19:47:14 +0000 (+0100) Subject: Remove Vector::operator +=. Removed some useless comments X-Git-Tag: SQUID_3_5_0_1~379^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0abe2ecd2a46841aaa8f71f7b2cbb7eb716bed6;p=thirdparty%2Fsquid.git Remove Vector::operator +=. Removed some useless comments --- diff --git a/src/DiskIO/DiskIOModule.cc b/src/DiskIO/DiskIOModule.cc index c72d290b24..2992f2237d 100644 --- a/src/DiskIO/DiskIOModule.cc +++ b/src/DiskIO/DiskIOModule.cc @@ -92,7 +92,6 @@ DiskIOModule::GetModules() void DiskIOModule::FreeAllModules() { - // TODO fix antipattern: walk the vector and then clear in one go while (!GetModules().empty()) { DiskIOModule *fs = GetModules().back(); GetModules().pop_back(); diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index ff441802c4..f0f3e454ea 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -748,11 +748,11 @@ HttpHeaderEntry * HttpHeader::getEntry(HttpHeaderPos * pos) const { assert(pos); - assert(*pos >= HttpHeaderInitPos && *pos < (ssize_t)entries.size()); + assert(*pos >= HttpHeaderInitPos && *pos < static_cast(entries.size())); - for (++(*pos); *pos < (ssize_t)entries.size(); ++(*pos)) { + for (++(*pos); *pos < static_cast(entries.size()); ++(*pos)) { if (entries[*pos]) - return (HttpHeaderEntry*)entries[*pos]; + return static_cast(entries[*pos]); } return NULL; @@ -871,8 +871,8 @@ void HttpHeader::delAt(HttpHeaderPos pos, int &headers_deleted) { HttpHeaderEntry *e; - assert(pos >= HttpHeaderInitPos && pos < (ssize_t)entries.size()); - e = (HttpHeaderEntry*)entries[pos]; + assert(pos >= HttpHeaderInitPos && pos < static_cast(entries.size())); + e = static_cast(entries[pos]); entries[pos] = NULL; /* decrement header length, allow for ": " and crlf */ len -= e->name.size() + 2 + e->value.size() + 2; diff --git a/src/StoreFileSystem.cc b/src/StoreFileSystem.cc index ad91f70802..293c37f4e2 100644 --- a/src/StoreFileSystem.cc +++ b/src/StoreFileSystem.cc @@ -87,7 +87,6 @@ StoreFileSystem::GetFileSystems() void StoreFileSystem::FreeAllFs() { - //TODO fix antipattern: call for all filesystems and clear in one go. while (!GetFileSystems().empty()) { StoreFileSystem *fs = GetFileSystems().back(); GetFileSystems().pop_back(); diff --git a/src/adaptation/Service.cc b/src/adaptation/Service.cc index 8a54e85456..10f1e642e8 100644 --- a/src/adaptation/Service.cc +++ b/src/adaptation/Service.cc @@ -71,7 +71,6 @@ Adaptation::FindService(const Service::Id& key) void Adaptation::DetachServices() { - // TODO fix antipattern: walk the vector and then clear in one go while (!AllServices().empty()) { AllServices().back()->detach(); AllServices().pop_back(); diff --git a/src/adaptation/icap/ServiceRep.cc b/src/adaptation/icap/ServiceRep.cc index 95d2d68a6b..ac295a767e 100644 --- a/src/adaptation/icap/ServiceRep.cc +++ b/src/adaptation/icap/ServiceRep.cc @@ -374,7 +374,6 @@ void Adaptation::Icap::ServiceRep::noteTimeToNotify() Pointer us = NULL; - // TODO fix antipattern: walk the vector and then clear in one go while (!theClients.empty()) { Client i = theClients.back(); theClients.pop_back(); diff --git a/src/base/Vector.h b/src/base/Vector.h index d76b5791f7..3e9207017b 100644 --- a/src/base/Vector.h +++ b/src/base/Vector.h @@ -100,7 +100,6 @@ public: void clear(); void reserve (size_t capacity); void push_back (E); - Vector &operator += (E item) {push_back(item); return *this;}; void insert (E); const E &front() const; diff --git a/src/errorpage.cc b/src/errorpage.cc index 92ab11c91e..cf74c3a449 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -60,6 +60,8 @@ #include "ssl/ErrorDetailManager.h" #endif +#include + /** \defgroup ErrorPageInternal Error Page Internals \ingroup ErrorPageAPI @@ -247,7 +249,6 @@ errorClean(void) safe_free(error_text); } - //TODO fix entipattern: destroy pages and then clear in one go while (!ErrorDynamicPages.empty()) { errorDynamicPageInfoDestroy(ErrorDynamicPages.back()); ErrorDynamicPages.pop_back();