ConfigOptionVector::~ConfigOptionVector()
{
- while (options.size()) {
+ while (!options.empty()) {
delete options.back();
options.pop_back();
}
void
DiskIOModule::FreeAllModules()
{
- while (GetModules().size()) {
+ // TODO fix antipattern: walk the vector and then clear in one go
+ while (!GetModules().empty()) {
DiskIOModule *fs = GetModules().back();
GetModules().pop_back();
fs->gracefulShutdown();
HttpHdrRange::~HttpHdrRange()
{
- while (specs.size()) {
+ while (!specs.empty()) {
delete specs.back();
specs.pop_back();
}
void
StoreFileSystem::FreeAllFs()
{
- while (GetFileSystems().size()) {
+ //TODO fix antipattern: call for all filesystems and clear in one go.
+ while (!GetFileSystems().empty()) {
StoreFileSystem *fs = GetFileSystems().back();
GetFileSystems().pop_back();
fs->done();
void Adaptation::DetachServices()
{
+ // TODO fix antipattern: walk the vector and then clear in one go
while (!AllServices().empty()) {
AllServices().back()->detach();
AllServices().pop_back();
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();
safe_free(error_text);
}
- while (ErrorDynamicPages.size()) {
+ //TODO fix entipattern: destroy pages and then clear in one go
+ while (!ErrorDynamicPages.empty()) {
errorDynamicPageInfoDestroy(ErrorDynamicPages.back());
ErrorDynamicPages.pop_back();
}
{
freeResources();
- while (variablesForCleanup.size()) {
+ while (!variablesForCleanup.empty()) {
delete variablesForCleanup.back();
variablesForCleanup.pop_back();
}
bool
StoreSearchHashIndex::next()
{
- if (entries.size())
+ if (!entries.empty())
entries.pop_back();
while (!isDone() && !entries.size())